fhir-data-generator


Namefhir-data-generator JSON
Version 1.6.1 PyPI version JSON
download
home_pagehttps://github.com/peter279k/fhir-data-generator
SummaryThe quick FHIR data generator for Python.
upload_time2024-09-06 07:03:53
maintainerNone
docs_urlNone
authorPeter Li
requires_python<4.0,>=3.8
licenseMIT
keywords fhir data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Development setup

- Running the `git clone` to clone the repository.
- Preparing for the `pipenv` environment.
- Running the `pipenv install` command to install packages.
- Running the `pipenv install -d` command to install development packages.
- Running the `pipenv run poetry install` command to install local package.
- Running the `pipenv run pytest -vv` to run unit tests.
- Running the `pipenv run pytest --cov --cov-report html` to run unit tests and generate coverage report with the HTML format. The report will be generated in the `htmlcov` directory.

# Publishing package steps

- Running the `poetry check` command to check whether everything is okay.
- Running the `poetry build` command to build archived Python package file.
- Running the `poetry config pypi-token.pypi <pypi token>` command to configure Pypi token.
- Running the `poetry publish` command to publish the Python package.

# Publish package to test-pypi

- Running the `poetry config repositories.test-pypi https://test.pypi.org/legacy/` command to configure testPypi URL.
- Running the `poetry config pypi-token.test-pypi <test_pypi_token>` command to configure testPypi token.
- Running the `poetry publish -r test-pypi` command to publish the testPypi.

# Patients Examples

## Patient SC1

```python
import json
import uuid
from fhir_data_generator import Patient


patient = Patient(str(uuid.uuid4()))
patient.set_profile_url('https://fhir.server/path/to/profile/path')

identifier1 = {
    'use': 'official',
    'system': 'http://www.boca.gov.tw',
    'type': {
        'coding': [
            {
                'system': 'http://www.boca.gov.tw',
                'code': 'PPN',
                'display': 'Passport number',
            },
        ],
    },
    'value': '262344368',
}
identifier2 = {
    'use': 'official',
    'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
    'type': {
        'coding': [
            {
                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
                'code': 'MR',
                'display': 'Medical record number',
            },
        ]
    },
    'value': '123456789',
}
managing_organization = 'Organization/MITW.ForIdentifier'
name = {
    'use': 'official',
    'text': '李小明',
    'family': '李',
    'given': ['小明'],
}
gender = 'male'
birth_date = '2023-12-23'
addresses = [
    {
        'use': 'home',
        'text': '105台北市松山區民生東路四段133號',
    },
    {
        'country': 'TW',
    },
]
scenario = 1
telecom = {
    'use': 'home',
    'system': 'phone',
    'value': '0905285349',
}

patient.set_identifier(identifier1)
patient.set_identifier(identifier2)
patient.set_active(True)
patient.set_managing_organization(managing_organization)
patient.set_name(name)
patient.set_gender(gender)
patient.set_birth_date(birth_date)
patient.set_address(addresses[0])
patient.set_address(addresses[1])
patient.set_telecom(telecom)

# Retrieving the Patient resource dict
patient_json_dict = patient.create(1)
print(patient_json_dict)

# Retrieve the Patient resource JSON string
print(json.dumps(patient_json_dict))
```
## Patient SC2

```python
import json
import uuid
from fhir_data_generator import Patient


patient = Patient(str(uuid.uuid4()))

patient.set_profile_url('https://fhir.server/path/to/profile/path')

identifier1 = {
    'use': 'official',
    'system': 'http://www.boca.gov.tw',
    'type': {
        'coding': [
            {
                'system': 'http://www.boca.gov.tw',
                'code': 'PPN',
                'display': 'Passport number',
            },
        ],
    },
    'value': '262344368',
}
identifier2 = {
    'use': 'official',
    'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
    'type': {
        'coding': [
            {
                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
                'code': 'MR',
                'display': 'Medical record number',
            },
        ]
    },
    'value': '123456789',
}

patient.set_identifier(identifier1)
patient.set_identifier(identifier2)

patient.set_active(True)

managing_organization = 'Organization/MITW.ForIdentifier'
patient.set_managing_organization(managing_organization)

names = [
    {
        'use': 'official',
        'family': 'Li',
        'given': [
            'Peter'
        ],
        'text': 'Peter Li',
    },
]

patient.set_name(names[0])

gender = 'male'
patient.set_gender(gender)

birth_date = '2023-12-23'
patient.set_birth_date(birth_date)

addresses = [
    {
        'use': 'home',
        'text': '105台北市松山區民生東路四段133號',
    },
    {
        'country': 'TW',
    },
]

patient.set_address(addresses[0])
patient.set_address(addresses[1])

telecom = {
    'use': 'home',
    'system': 'phone',
    'value': '0905285349',
}
patient.set_telecom(telecom)

communications = [
    {
        'language': {
            'coding': [
                {
                    'system': 'http://terminology.hl7.org/CodeSystem/v3-ietf3066',
                    'code': 'en-US',
                },
            ],
            'text': 'English (US)',
        },
    },
]

patient.set_communication(communications[0])

scenario = 2

# Retrieving the Patient resource dict
patient_json_dict = patient.create(scenario)
print(patient_json_dict)

# Retrieve the Patient resource JSON string
print(json.dumps(patient_json_dict))
```

## Patient SC3

```python
import json
import uuid
from fhir_data_generator import Patient


patient = Patient(str(uuid.uuid4()))
patient.set_profile_url('https://fhir.server/path/to/profile/path')

patient.set_identifier(identifiers[0])
patient.set_identifier(identifiers[1])

names = [
    {
        'use': 'official',
        'text': '李小明',
        'family': '李',
        'given': ['小明'],
    },
]
patient_class.set_name(names[0])

gender = 'male'
patient.set_gender(gender)

birth_date = '2023-12-23'
patient.set_birth_date(birth_date)

contacts = [
    {
        'relationship': [
            {
                'coding': [
                    {
                        'system': 'http://terminology.hl7.org/CodeSystem/v2-0131',
                        'code': 'CP',
                    },
                ],
                'text': 'Contact person',
            },
        ],
        'name': {
            'text': 'Peter Li',
            'family': 'Li',
            'given': [
                'Peter',
            ],
        },
    },
]
patient.set_contact(contacts[0])

addresses = [
    {
        'use': 'home',
        'text': '105台北市松山區民生東路四段133號',
        'line': ['民生東路'],
        'city': '台北市',
        'district': '松山區',
        '_postalCode': {
            'extension': [{
                'url': 'https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/tw-postal-code',
                'valueCodeableConcept': {
                    'coding': [{
                        'system': 'https://twcore.mohw.gov.tw/ig/twcore/CodeSystem/postal-code3-tw',
                        'code': '105'
                    }]
                }
            }]
        },
        'country': 'TW',
    }
 ]
patient.set_address(addresses[0])

telecoms = [
    {
        'system': 'phone',
        'value': '0905285349',
        'use': 'mobile',
    },
    {
        'system': 'email', 'value': 'kamsung@company.com'
    },
    {
        'system': 'url',
        'value': 'https://line.me/ti/p/34b2c384l5'
    }
]
patient.set_telecom(telecoms[0])
patient.set_telecom(telecoms[1])
patient.set_telecom(telecoms[2])

patient.set_active(True)

managing_organization = 'Organization/MITW.ForIdentifier'
patient.set_managing_organization(managing_organization)

scenario = 3

# Retrieving the Patient resource dict
patient_json_dict = patient.create(scenario)
print(patient_json_dict)

# Retrieve the Patient resource JSON string
print(json.dumps(patient_json_dict))
```

## Observation BMI Example

```python
import json
import uuid
from fhir_data_generator import Observation


observation = Observation(str(uuid.uuid4()))

profile_urls = ['https://fhir.server/path/to/profile/path']
observation.set_profile_urls(profile_urls)

status = 'final'
observation.set_status(status)

category_coding = [{
    'system': 'http://terminology.hl7.org/CodeSystem/observation-category',
    'code': 'vital-signs',
    'display': 'Vital Signs',
}]
observation.set_category_coding(category_coding)

code_coding = [{
    'system': 'https://twcore.mohw.gov.tw/ig/twcore/CodeSystem/loinc-tw',
    'code': '39156-5',
    'display': 'Body mass index (BMI) [Ratio]',
}]
observation.set_code_coding(code_coding)

code_text = 'Body mass index (BMI) [Ratio]'
observation.set_code_text(code_text)

subject= {
    'reference': 'Patient/pat-example',
}
observation.set_subject(subject)

effective_datetime = '2023-12-23'
observation.set_effective_datetime(effective_datetime)

performer = [{
    'reference': 'Practitioner/pra-dr-example',
}]
observation.set_performer(performer)

value_quantity = {
    'value': 18.3,
    'unit': 'kg/m2',
    'system': 'http://unitsofmeasure.org',
    'code': 'kg/m2',
}
observation.set_value_quantity(value_quantity)

# Retrieving the Observation resource dict
observation_json_dict = observation.create()
print(observation_json_dict)

# Retrieve the Observation resource JSON string
print(json.dumps(observation_json_dict))
```

### CarePlan Example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import CarePlan


care_plan = CarePlan(str(uuid.uuid4()))

profile_urls = [
    'https://hapi.fhir.tw/fhir/StructureDefinition/Careplan-sport',
]
care_plan.set_profile_urls(profile_urls)

status = 'active'
care_plan.set_status(status)

intent = 'plan'
care_plan.set_intent(intent)

category_coding = [
    {
        'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',
        'code': 'PhysicalActivity',
        'display': 'Physical Activity',
    }
]
care_plan.set_category_coding(category_coding)

description = '椎間盤間隔小/退化擠壓狀況 核心訓練以髖部(臀部)和腹部訓練為主'
care_plan.set_description(description)

subject = {
    'reference': 'Patient/patient-tw-example',
}
care_plan.set_subject(subject)

author = {
    'reference': 'Practitioner/practitioner-c-example'
}
care_plan.set_author(author)

goal = [{
    'reference': 'Goal/goal-example',
}]
care_plan.set_goal(goal)

activity_progress = [
    {
        'time': '2024-07-03',
        'text': '滾筒放鬆:1.胸椎伸展 8趟 2.上背滾動 10趟 3.胸椎旋轉 左右各8次 核心:1.死蟲 後腳跟點地板 單邊各六下 兩組 2.橋式+彈力圈 20下 1組 3.徒手弓箭步單側負重6公斤10下一組,前腳墊高10下一組',
    },
]
care_plan.set_activity_progress(activity_progress)

activity_detail = {
    'status': 'completed',
    'description': '機械臀推/彈力箱臀推 感受度不佳 暫時不做',
}
care_plan.set_activity_detail(activity_detail)

note = [{
    'time': '2024-07-04',
    'text': '肚臍對應後方腰椎摸會痛,活動筋骨及輕微推拿後有好一點',
}]
care_plan.set_note(note)

# Retrieving the CarePlan resource dict
care_plan_json_dict = care_plan.create()
print(care_plan_json_dict)

# Retrieve the CarePlan resource JSON string
print(json.dumps(care_plan_json_dict))
```

### Goal Example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import Goal


goal = Goal(str(uuid.uuid4()))

profile_urls = [
    'https://hapi.fhir.tw/fhir/StructureDefinition/Goal-sport',
]
goal.set_profile_urls(profile_urls)

lifecycle_status = 'proposed'
goal.set_lifecycle_status(lifecycle_status)

category_coding = [{
    'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',
    'code': 'PhysicalActivity',
    'display': 'Physical Activity'
}]
goal.set_category_coding(category_coding)

description_text = 'L5-S1椎間盤突出,在六個月內減少突出程度2-3毫米,疼痛評分減少50%'
goal.set_description_text(description_text)

subject = {
    'reference': 'Patient/patient-tw-example',
}
goal.set_subject(subject)

target_measure_coding = [{
    'system': 'http://loinc.org',
    'code': '41950-7',
    'display': 'Number of steps in 24 hour Measured',
}]
goal.set_target_measure_coding(target_measure_coding)

target_detail_quantity = {
    'value': 5000,
    'unit': 'steps per day',
    'system': 'http://unitsofmeasure.org',
    'code': '/d',
}
goal.set_target_detail_quantity(target_detail_quantity)

# Retrieving the Goal resource dict
goal_json_dict = goal.create()
print(goal_json_dict)

# Retrieve the Goal resource JSON string
print(json.dumps(goal_json_dict))
```

### Practitioner for Physical Activity Example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import PhysicalActivityPractitioner as Practitioner


practitioner = Practitioner(str(uuid.uuid4()))

profile_urls = [
    'https://hapi.fhir.tw/fhir/StructureDefinition/TWCorePractitioner',
]
practitioner.set_profile_urls(profile_urls)

identifiers = [
    {
        'use': 'official',
        'type': {
            'coding': [{
                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
                'code': 'MB'
            }]
        },
        'system': 'https://www.morefit.com.tw/tw',
        'value': 'S1006',
    }
]
practitioner.set_identifiers(identifiers)

active = True
practitioner.set_active(active)

name_text = '陳漸升'
practitioner.set_name_text(name_text)

# Retrieving the Practitioner for Physical Activity resource dict
practitioner_json_dict = practitioner.create()
print(practitioner_json_dict)

# Retrieve the Practitioner for Physical Activity resource JSON string
print(json.dumps(practitioner_json_dict))
```

### Condition E for Physical Activity Example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import ConditionE


condition_e = ConditionE(str(uuid.uuid4()))

profile_urls = [
    'https://hapi.fhir.tw/fhir/StructureDefinition/Condition-excercise-history',
]
condition_e.set_profile_urls(profile_urls)

clinical_status_coding = [{
    'system': 'http://terminology.hl7.org/CodeSystem/condition-clinical',
    'code': 'active',
}]
condition_e.set_clinical_status_coding(clinical_status_coding)

category_coding = [{
    'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',
    'code': 'PhysicalActivity',
    'display': 'Physical Activity',
}]
condition_e.set_category_coding(category_coding)

code_coding =[{
    'system': 'http://snomed.info/sct',
    'code': '229072005',
    'display': 'Aerobic exercises',
}]
condition_e.set_code_coding(code_coding)

code_text = '一週2次有氧運動 每次30分鐘'
condition_e.set_code_text(code_text)

subject = {
    'reference': 'Patient/patient-tw-example',
}
condition_e.set_subject(subject)

asserter = {
    'reference': 'Practitioner/practitioner-d-example',
}
condition_e.set_asserter(asserter)

# Retrieving the Condition E for Physical Activity resource dict
condition_e_json_dict = condition_e.create()
print(condition_e_json_dict)

# Retrieve the Condition E for Physical Activity resource JSON string
print(json.dumps(condition_e_json_dict))
```

### Organization H for Physical Activity example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import OrganizationH


organization_h = OrganizationH(str(uuid.uuid4()))

profile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/TWCoreOrganization']
organization_h.set_profile_urls(profile_urls)

identifiers = [
    {
        'use': 'official',
        'type': {
            'coding': [{
                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
                'code': 'PRN'
            }],
        },
        'system': 'https://www.vghtpe.gov.tw',
        'value': '0601160016',
    },
]
organization_h.set_identifiers(identifiers)

type_coding = [{
    'system': 'http://terminology.hl7.org/CodeSystem/organization-type',
    'code': 'prov',
}]
organization_h.set_type_coding(type_coding)

name = '臺北醫院'
organization_h.set_name(name)

# Retrieving the Organization H for Physical Activity resource dict
organization_h_json_dict = organization_h.create()
print(organization_h_json_dict)

# Retrieve the Organization H for Physical Activity resource JSON string
print(json.dumps(organization_h_json_dict))
```

### Organization S for Physical Activity example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import OrganizationS


organization_s = OrganizationS(str(uuid.uuid4()))

profile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/TWCoreOrganization']
organization_s.set_profile_urls(profile_urls)

identifiers = [
    {
        'use': 'official',
        'type': {
            'coding': [{
                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
                'code': 'PRN'
            }],
        },
        'system': 'https://www.morefit.com.tw',
        'value': '85037366',
    },
]
organization_s.set_identifiers(identifiers)

type_coding = [{
    'system': 'http://terminology.hl7.org/CodeSystem/organization-type',
    'code': 'team',
}]
organization_s.set_type_coding(type_coding)

name = 'morefit
organization_s.set_name(name)

organization_s.create()

# Retrieving the Organization S for Physical Activity resource dict
organization_s_json_dict = organization_s.create()
print(organization_s_json_dict)

# Retrieve the Organization S for Physical Activity resource JSON string
print(json.dumps(organization_s_json_dict))
```

### Patient EX for Physical Activity example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import PatientEX


patient_ex = PatientEX(str(uuid.uuid4()))

profile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/Patient-sport']
patient_ex.set_profile_urls(profile_urls)

extension_url = 'https://hapi.fhir.tw/fhir/StructureDefinition/person-age'
patient_ex.set_extension_url(extension_url)

extension_value_age = {
    'value': 32,
    'unit': '32',
    'system': 'http://unitsofmeasure.org',
    'code': 'a',
}
patient_ex.set_extension_value_age(extension_value_age)

identifiers = [{
    'system': 'https://www.morefit.com.tw',
    'value': '0938110330',
}]
patient_ex.set_identifiers(identifiers)

name_text = '連小妹'
patient_ex.set_name_text(name_text)

gender = 'female'
patient_ex.set_gender(gender)

birth_date = '1990-01-01'
patient_ex.set_birth_date(birth_date)

# Retrieving the Patient EX for Physical Activity resource dict
patient_ex_json_dict = patient_ex.create()
print(patient_ex_json_dict)

# Retrieve the Patient EX for Physical Activity resource JSON string
print(json.dumps(patient_ex_json_dict))
```

### Patient TW for Physical Activity example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import PatientTW


patient_tw = PatientTW(str(uuid.uuid4()))

profile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/TWCorePatient']
patient_tw.set_profile_urls(profile_urls)

extension_url = 'https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/person-age'
patient_tw.set_extension_url(extension_url)

extension_value_age = {
    'value': 32,
    'system': 'http://unitsofmeasure.org',
    'code': 'a',
}
patient_tw.set_extension_value_age(extension_value_age)

extension_extension_coding = [{
    'system': 'urn:iso:std:iso:3166',
    'code': 'TW',
}]
patient_tw.set_extension_extension_coding(extension_extension_coding)

extension_extension_url = 'http://hl7.org/fhir/StructureDefinition/patient-nationality'
patient_tw.set_extension_extension_url(extension_extension_url)

identifiers = [{
    'use': 'official',
    'type': {
        'coding': [{
            'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',
            'code': 'NNxxx',
            '_code': {
                'extension': [{
                    'extension': [
                        {
                            'url': 'suffix',
                            'valueString': 'TWN'
                        },
                        {
                                'url': 'valueSet',
                                'valueCanonical': 'http://hl7.org/fhir/ValueSet/iso3166-1-3'
                        }
                    ],
                    'url': 'https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/identifier-suffix'
                }]
            }
        }]
    },
    'system': 'http://www.moi.gov.tw',
    'value': 'A123456789'
}]
patient_tw.set_identifiers(identifiers)

active = True
patient_tw.set_active(active)

name_user = 'official'
patient_tw.set_name_use(name_use)

name_text = '連小妹'
patient_tw.set_name_text(name_text)

gender = 'female'
patient_tw.set_gender(gender)

birth_date = '1990-01-01'
patient_tw.set_birth_date(birth_date)

# Retrieving the Patient TW for Physical Activity resource dict
patient_tw_json_dict = patient_tw.create()
print(patient_tw_json_dict)

# Retrieve the Patient TW for Physical Activity resource JSON string
print(json.dumps(patient_tw_json_dict))
```

### ServiceRequest for Physical Activity example (MITW 2024)

```python
import json
import uuid
from fhir_data_generator import PhysicalActivityServiceRequest


service_request = PhysicalActivityServiceRequest(str(uuid.uuid4()))

profile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/ServiceRequest-sport']
service_request.set_profile_urls(profile_urls)

identifiers = [{
    'system': 'https://www.health.ntpc.gov.tw/',
    'value': 's141526',
}]
service_request.set_identifiers(identifiers)

status = 'completed'
service_request.set_status(status)

intent = 'order'
service_request.set_intent(intent)

category_coding = [{
    'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',
    'code': 'PhysicalActivity',
    'display': 'Physical Activity'
}]
service_request.set_category_coding(category_coding)

code_coding = [{
    'system': 'http://snomed.info/sct',
    'code': '229065009',
    'display': 'Exercise therapy',
}]
service_request.set_code_coding(code_coding)

subject= {
    'reference': 'Patient/patient-tw-example',
}
service_request.set_subject(subject)

authored_on = '2024-07-01'
service_request.set_authored_on(authored_on)

requester = {
    'reference': 'Practitioner/practitioner-d-example',
}
service_request.set_requester(requester)

# Retrieving the ServiceRequest for Physical Activity resource dict
service_request_json_dict = service_request.create()
print(service_request_json_dict)

# Retrieve the ServiceRequest for Physical Activity resource JSON string
print(json.dumps(service_request_json_dict))
```

# References

- https://hackersandslackers.com/python-poetry-package-manager
- https://www.digitalocean.com/community/tutorials/how-to-publish-python-packages-to-pypi-using-poetry-on-ubuntu-22-04
- https://www.freecodecamp.org/news/how-to-build-and-publish-python-packages-with-poetry
- https://stackoverflow.com/questions/68882603/using-python-poetry-to-publish-to-test-pypi-org

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/peter279k/fhir-data-generator",
    "name": "fhir-data-generator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "FHIR, Data",
    "author": "Peter Li",
    "author_email": "peter279k@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/96/de/a7da2ed06a073a22a3b7f76ac4b6ffdc103579db1895b114fd6463646db3/fhir_data_generator-1.6.1.tar.gz",
    "platform": null,
    "description": "# Development setup\n\n- Running the `git clone` to clone the repository.\n- Preparing for the `pipenv` environment.\n- Running the `pipenv install` command to install packages.\n- Running the `pipenv install -d` command to install development packages.\n- Running the `pipenv run poetry install` command to install local package.\n- Running the `pipenv run pytest -vv` to run unit tests.\n- Running the `pipenv run pytest --cov --cov-report html` to run unit tests and generate coverage report with the HTML format. The report will be generated in the `htmlcov` directory.\n\n# Publishing package steps\n\n- Running the `poetry check` command to check whether everything is okay.\n- Running the `poetry build` command to build archived Python package file.\n- Running the `poetry config pypi-token.pypi <pypi token>` command to configure Pypi token.\n- Running the `poetry publish` command to publish the Python package.\n\n# Publish package to test-pypi\n\n- Running the `poetry config repositories.test-pypi https://test.pypi.org/legacy/` command to configure testPypi URL.\n- Running the `poetry config pypi-token.test-pypi <test_pypi_token>` command to configure testPypi token.\n- Running the `poetry publish -r test-pypi` command to publish the testPypi.\n\n# Patients Examples\n\n## Patient SC1\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import Patient\n\n\npatient = Patient(str(uuid.uuid4()))\npatient.set_profile_url('https://fhir.server/path/to/profile/path')\n\nidentifier1 = {\n    'use': 'official',\n    'system': 'http://www.boca.gov.tw',\n    'type': {\n        'coding': [\n            {\n                'system': 'http://www.boca.gov.tw',\n                'code': 'PPN',\n                'display': 'Passport number',\n            },\n        ],\n    },\n    'value': '262344368',\n}\nidentifier2 = {\n    'use': 'official',\n    'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n    'type': {\n        'coding': [\n            {\n                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n                'code': 'MR',\n                'display': 'Medical record number',\n            },\n        ]\n    },\n    'value': '123456789',\n}\nmanaging_organization = 'Organization/MITW.ForIdentifier'\nname = {\n    'use': 'official',\n    'text': '\u674e\u5c0f\u660e',\n    'family': '\u674e',\n    'given': ['\u5c0f\u660e'],\n}\ngender = 'male'\nbirth_date = '2023-12-23'\naddresses = [\n    {\n        'use': 'home',\n        'text': '105\u53f0\u5317\u5e02\u677e\u5c71\u5340\u6c11\u751f\u6771\u8def\u56db\u6bb5133\u865f',\n    },\n    {\n        'country': 'TW',\n    },\n]\nscenario = 1\ntelecom = {\n    'use': 'home',\n    'system': 'phone',\n    'value': '0905285349',\n}\n\npatient.set_identifier(identifier1)\npatient.set_identifier(identifier2)\npatient.set_active(True)\npatient.set_managing_organization(managing_organization)\npatient.set_name(name)\npatient.set_gender(gender)\npatient.set_birth_date(birth_date)\npatient.set_address(addresses[0])\npatient.set_address(addresses[1])\npatient.set_telecom(telecom)\n\n# Retrieving the Patient resource dict\npatient_json_dict = patient.create(1)\nprint(patient_json_dict)\n\n# Retrieve the Patient resource JSON string\nprint(json.dumps(patient_json_dict))\n```\n## Patient SC2\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import Patient\n\n\npatient = Patient(str(uuid.uuid4()))\n\npatient.set_profile_url('https://fhir.server/path/to/profile/path')\n\nidentifier1 = {\n    'use': 'official',\n    'system': 'http://www.boca.gov.tw',\n    'type': {\n        'coding': [\n            {\n                'system': 'http://www.boca.gov.tw',\n                'code': 'PPN',\n                'display': 'Passport number',\n            },\n        ],\n    },\n    'value': '262344368',\n}\nidentifier2 = {\n    'use': 'official',\n    'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n    'type': {\n        'coding': [\n            {\n                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n                'code': 'MR',\n                'display': 'Medical record number',\n            },\n        ]\n    },\n    'value': '123456789',\n}\n\npatient.set_identifier(identifier1)\npatient.set_identifier(identifier2)\n\npatient.set_active(True)\n\nmanaging_organization = 'Organization/MITW.ForIdentifier'\npatient.set_managing_organization(managing_organization)\n\nnames = [\n    {\n        'use': 'official',\n        'family': 'Li',\n        'given': [\n            'Peter'\n        ],\n        'text': 'Peter Li',\n    },\n]\n\npatient.set_name(names[0])\n\ngender = 'male'\npatient.set_gender(gender)\n\nbirth_date = '2023-12-23'\npatient.set_birth_date(birth_date)\n\naddresses = [\n    {\n        'use': 'home',\n        'text': '105\u53f0\u5317\u5e02\u677e\u5c71\u5340\u6c11\u751f\u6771\u8def\u56db\u6bb5133\u865f',\n    },\n    {\n        'country': 'TW',\n    },\n]\n\npatient.set_address(addresses[0])\npatient.set_address(addresses[1])\n\ntelecom = {\n    'use': 'home',\n    'system': 'phone',\n    'value': '0905285349',\n}\npatient.set_telecom(telecom)\n\ncommunications = [\n    {\n        'language': {\n            'coding': [\n                {\n                    'system': 'http://terminology.hl7.org/CodeSystem/v3-ietf3066',\n                    'code': 'en-US',\n                },\n            ],\n            'text': 'English (US)',\n        },\n    },\n]\n\npatient.set_communication(communications[0])\n\nscenario = 2\n\n# Retrieving the Patient resource dict\npatient_json_dict = patient.create(scenario)\nprint(patient_json_dict)\n\n# Retrieve the Patient resource JSON string\nprint(json.dumps(patient_json_dict))\n```\n\n## Patient SC3\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import Patient\n\n\npatient = Patient(str(uuid.uuid4()))\npatient.set_profile_url('https://fhir.server/path/to/profile/path')\n\npatient.set_identifier(identifiers[0])\npatient.set_identifier(identifiers[1])\n\nnames = [\n    {\n        'use': 'official',\n        'text': '\u674e\u5c0f\u660e',\n        'family': '\u674e',\n        'given': ['\u5c0f\u660e'],\n    },\n]\npatient_class.set_name(names[0])\n\ngender = 'male'\npatient.set_gender(gender)\n\nbirth_date = '2023-12-23'\npatient.set_birth_date(birth_date)\n\ncontacts = [\n    {\n        'relationship': [\n            {\n                'coding': [\n                    {\n                        'system': 'http://terminology.hl7.org/CodeSystem/v2-0131',\n                        'code': 'CP',\n                    },\n                ],\n                'text': 'Contact person',\n            },\n        ],\n        'name': {\n            'text': 'Peter Li',\n            'family': 'Li',\n            'given': [\n                'Peter',\n            ],\n        },\n    },\n]\npatient.set_contact(contacts[0])\n\naddresses = [\n    {\n        'use': 'home',\n        'text': '105\u53f0\u5317\u5e02\u677e\u5c71\u5340\u6c11\u751f\u6771\u8def\u56db\u6bb5133\u865f',\n        'line': ['\u6c11\u751f\u6771\u8def'],\n        'city': '\u53f0\u5317\u5e02',\n        'district': '\u677e\u5c71\u5340',\n        '_postalCode': {\n            'extension': [{\n                'url': 'https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/tw-postal-code',\n                'valueCodeableConcept': {\n                    'coding': [{\n                        'system': 'https://twcore.mohw.gov.tw/ig/twcore/CodeSystem/postal-code3-tw',\n                        'code': '105'\n                    }]\n                }\n            }]\n        },\n        'country': 'TW',\n    }\n ]\npatient.set_address(addresses[0])\n\ntelecoms = [\n    {\n        'system': 'phone',\n        'value': '0905285349',\n        'use': 'mobile',\n    },\n    {\n        'system': 'email', 'value': 'kamsung@company.com'\n    },\n    {\n        'system': 'url',\n        'value': 'https://line.me/ti/p/34b2c384l5'\n    }\n]\npatient.set_telecom(telecoms[0])\npatient.set_telecom(telecoms[1])\npatient.set_telecom(telecoms[2])\n\npatient.set_active(True)\n\nmanaging_organization = 'Organization/MITW.ForIdentifier'\npatient.set_managing_organization(managing_organization)\n\nscenario = 3\n\n# Retrieving the Patient resource dict\npatient_json_dict = patient.create(scenario)\nprint(patient_json_dict)\n\n# Retrieve the Patient resource JSON string\nprint(json.dumps(patient_json_dict))\n```\n\n## Observation BMI Example\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import Observation\n\n\nobservation = Observation(str(uuid.uuid4()))\n\nprofile_urls = ['https://fhir.server/path/to/profile/path']\nobservation.set_profile_urls(profile_urls)\n\nstatus = 'final'\nobservation.set_status(status)\n\ncategory_coding = [{\n    'system': 'http://terminology.hl7.org/CodeSystem/observation-category',\n    'code': 'vital-signs',\n    'display': 'Vital Signs',\n}]\nobservation.set_category_coding(category_coding)\n\ncode_coding = [{\n    'system': 'https://twcore.mohw.gov.tw/ig/twcore/CodeSystem/loinc-tw',\n    'code': '39156-5',\n    'display': 'Body mass index (BMI) [Ratio]',\n}]\nobservation.set_code_coding(code_coding)\n\ncode_text = 'Body mass index (BMI) [Ratio]'\nobservation.set_code_text(code_text)\n\nsubject= {\n    'reference': 'Patient/pat-example',\n}\nobservation.set_subject(subject)\n\neffective_datetime = '2023-12-23'\nobservation.set_effective_datetime(effective_datetime)\n\nperformer = [{\n    'reference': 'Practitioner/pra-dr-example',\n}]\nobservation.set_performer(performer)\n\nvalue_quantity = {\n    'value': 18.3,\n    'unit': 'kg/m2',\n    'system': 'http://unitsofmeasure.org',\n    'code': 'kg/m2',\n}\nobservation.set_value_quantity(value_quantity)\n\n# Retrieving the Observation resource dict\nobservation_json_dict = observation.create()\nprint(observation_json_dict)\n\n# Retrieve the Observation resource JSON string\nprint(json.dumps(observation_json_dict))\n```\n\n### CarePlan Example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import CarePlan\n\n\ncare_plan = CarePlan(str(uuid.uuid4()))\n\nprofile_urls = [\n    'https://hapi.fhir.tw/fhir/StructureDefinition/Careplan-sport',\n]\ncare_plan.set_profile_urls(profile_urls)\n\nstatus = 'active'\ncare_plan.set_status(status)\n\nintent = 'plan'\ncare_plan.set_intent(intent)\n\ncategory_coding = [\n    {\n        'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',\n        'code': 'PhysicalActivity',\n        'display': 'Physical Activity',\n    }\n]\ncare_plan.set_category_coding(category_coding)\n\ndescription = '\u690e\u9593\u76e4\u9593\u9694\u5c0f/\u9000\u5316\u64e0\u58d3\u72c0\u6cc1 \u6838\u5fc3\u8a13\u7df4\u4ee5\u9ad6\u90e8(\u81c0\u90e8)\u548c\u8179\u90e8\u8a13\u7df4\u70ba\u4e3b'\ncare_plan.set_description(description)\n\nsubject = {\n    'reference': 'Patient/patient-tw-example',\n}\ncare_plan.set_subject(subject)\n\nauthor = {\n    'reference': 'Practitioner/practitioner-c-example'\n}\ncare_plan.set_author(author)\n\ngoal = [{\n    'reference': 'Goal/goal-example',\n}]\ncare_plan.set_goal(goal)\n\nactivity_progress = [\n    {\n        'time': '2024-07-03',\n        'text': '\u6efe\u7b52\u653e\u9b06\uff1a1.\u80f8\u690e\u4f38\u5c55 8\u8d9f 2.\u4e0a\u80cc\u6efe\u52d5 10\u8d9f 3.\u80f8\u690e\u65cb\u8f49 \u5de6\u53f3\u54048\u6b21 \u6838\u5fc3\uff1a1.\u6b7b\u87f2 \u5f8c\u8173\u8ddf\u9ede\u5730\u677f \u55ae\u908a\u5404\u516d\u4e0b \u5169\u7d44 2.\u6a4b\u5f0f+\u5f48\u529b\u5708 20\u4e0b 1\u7d44 3.\u5f92\u624b\u5f13\u7bad\u6b65\u55ae\u5074\u8ca0\u91cd6\u516c\u65a410\u4e0b\u4e00\u7d44,\u524d\u8173\u588a\u9ad810\u4e0b\u4e00\u7d44',\n    },\n]\ncare_plan.set_activity_progress(activity_progress)\n\nactivity_detail = {\n    'status': 'completed',\n    'description': '\u6a5f\u68b0\u81c0\u63a8/\u5f48\u529b\u7bb1\u81c0\u63a8 \u611f\u53d7\u5ea6\u4e0d\u4f73 \u66ab\u6642\u4e0d\u505a',\n}\ncare_plan.set_activity_detail(activity_detail)\n\nnote = [{\n    'time': '2024-07-04',\n    'text': '\u809a\u81cd\u5c0d\u61c9\u5f8c\u65b9\u8170\u690e\u6478\u6703\u75db\uff0c\u6d3b\u52d5\u7b4b\u9aa8\u53ca\u8f15\u5fae\u63a8\u62ff\u5f8c\u6709\u597d\u4e00\u9ede',\n}]\ncare_plan.set_note(note)\n\n# Retrieving the CarePlan resource dict\ncare_plan_json_dict = care_plan.create()\nprint(care_plan_json_dict)\n\n# Retrieve the CarePlan resource JSON string\nprint(json.dumps(care_plan_json_dict))\n```\n\n### Goal Example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import Goal\n\n\ngoal = Goal(str(uuid.uuid4()))\n\nprofile_urls = [\n    'https://hapi.fhir.tw/fhir/StructureDefinition/Goal-sport',\n]\ngoal.set_profile_urls(profile_urls)\n\nlifecycle_status = 'proposed'\ngoal.set_lifecycle_status(lifecycle_status)\n\ncategory_coding = [{\n    'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',\n    'code': 'PhysicalActivity',\n    'display': 'Physical Activity'\n}]\ngoal.set_category_coding(category_coding)\n\ndescription_text = 'L5-S1\u690e\u9593\u76e4\u7a81\u51fa\uff0c\u5728\u516d\u500b\u6708\u5167\u6e1b\u5c11\u7a81\u51fa\u7a0b\u5ea62-3\u6beb\u7c73\uff0c\u75bc\u75db\u8a55\u5206\u6e1b\u5c1150%'\ngoal.set_description_text(description_text)\n\nsubject = {\n    'reference': 'Patient/patient-tw-example',\n}\ngoal.set_subject(subject)\n\ntarget_measure_coding = [{\n    'system': 'http://loinc.org',\n    'code': '41950-7',\n    'display': 'Number of steps in 24 hour Measured',\n}]\ngoal.set_target_measure_coding(target_measure_coding)\n\ntarget_detail_quantity = {\n    'value': 5000,\n    'unit': 'steps per day',\n    'system': 'http://unitsofmeasure.org',\n    'code': '/d',\n}\ngoal.set_target_detail_quantity(target_detail_quantity)\n\n# Retrieving the Goal resource dict\ngoal_json_dict = goal.create()\nprint(goal_json_dict)\n\n# Retrieve the Goal resource JSON string\nprint(json.dumps(goal_json_dict))\n```\n\n### Practitioner for Physical Activity Example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import PhysicalActivityPractitioner as Practitioner\n\n\npractitioner = Practitioner(str(uuid.uuid4()))\n\nprofile_urls = [\n    'https://hapi.fhir.tw/fhir/StructureDefinition/TWCorePractitioner',\n]\npractitioner.set_profile_urls(profile_urls)\n\nidentifiers = [\n    {\n        'use': 'official',\n        'type': {\n            'coding': [{\n                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n                'code': 'MB'\n            }]\n        },\n        'system': 'https://www.morefit.com.tw/tw',\n        'value': 'S1006',\n    }\n]\npractitioner.set_identifiers(identifiers)\n\nactive = True\npractitioner.set_active(active)\n\nname_text = '\u9673\u6f38\u5347'\npractitioner.set_name_text(name_text)\n\n# Retrieving the Practitioner for Physical Activity resource dict\npractitioner_json_dict = practitioner.create()\nprint(practitioner_json_dict)\n\n# Retrieve the Practitioner for Physical Activity resource JSON string\nprint(json.dumps(practitioner_json_dict))\n```\n\n### Condition E for Physical Activity Example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import ConditionE\n\n\ncondition_e = ConditionE(str(uuid.uuid4()))\n\nprofile_urls = [\n    'https://hapi.fhir.tw/fhir/StructureDefinition/Condition-excercise-history',\n]\ncondition_e.set_profile_urls(profile_urls)\n\nclinical_status_coding = [{\n    'system': 'http://terminology.hl7.org/CodeSystem/condition-clinical',\n    'code': 'active',\n}]\ncondition_e.set_clinical_status_coding(clinical_status_coding)\n\ncategory_coding = [{\n    'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',\n    'code': 'PhysicalActivity',\n    'display': 'Physical Activity',\n}]\ncondition_e.set_category_coding(category_coding)\n\ncode_coding =[{\n    'system': 'http://snomed.info/sct',\n    'code': '229072005',\n    'display': 'Aerobic exercises',\n}]\ncondition_e.set_code_coding(code_coding)\n\ncode_text = '\u4e00\u90312\u6b21\u6709\u6c27\u904b\u52d5 \u6bcf\u6b2130\u5206\u9418'\ncondition_e.set_code_text(code_text)\n\nsubject = {\n    'reference': 'Patient/patient-tw-example',\n}\ncondition_e.set_subject(subject)\n\nasserter = {\n    'reference': 'Practitioner/practitioner-d-example',\n}\ncondition_e.set_asserter(asserter)\n\n# Retrieving the Condition E for Physical Activity resource dict\ncondition_e_json_dict = condition_e.create()\nprint(condition_e_json_dict)\n\n# Retrieve the Condition E for Physical Activity resource JSON string\nprint(json.dumps(condition_e_json_dict))\n```\n\n### Organization H for Physical Activity example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import OrganizationH\n\n\norganization_h = OrganizationH(str(uuid.uuid4()))\n\nprofile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/TWCoreOrganization']\norganization_h.set_profile_urls(profile_urls)\n\nidentifiers = [\n    {\n        'use': 'official',\n        'type': {\n            'coding': [{\n                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n                'code': 'PRN'\n            }],\n        },\n        'system': 'https://www.vghtpe.gov.tw',\n        'value': '0601160016',\n    },\n]\norganization_h.set_identifiers(identifiers)\n\ntype_coding = [{\n    'system': 'http://terminology.hl7.org/CodeSystem/organization-type',\n    'code': 'prov',\n}]\norganization_h.set_type_coding(type_coding)\n\nname = '\u81fa\u5317\u91ab\u9662'\norganization_h.set_name(name)\n\n# Retrieving the Organization H for Physical Activity resource dict\norganization_h_json_dict = organization_h.create()\nprint(organization_h_json_dict)\n\n# Retrieve the Organization H for Physical Activity resource JSON string\nprint(json.dumps(organization_h_json_dict))\n```\n\n### Organization S for Physical Activity example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import OrganizationS\n\n\norganization_s = OrganizationS(str(uuid.uuid4()))\n\nprofile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/TWCoreOrganization']\norganization_s.set_profile_urls(profile_urls)\n\nidentifiers = [\n    {\n        'use': 'official',\n        'type': {\n            'coding': [{\n                'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n                'code': 'PRN'\n            }],\n        },\n        'system': 'https://www.morefit.com.tw',\n        'value': '85037366',\n    },\n]\norganization_s.set_identifiers(identifiers)\n\ntype_coding = [{\n    'system': 'http://terminology.hl7.org/CodeSystem/organization-type',\n    'code': 'team',\n}]\norganization_s.set_type_coding(type_coding)\n\nname = 'morefit\norganization_s.set_name(name)\n\norganization_s.create()\n\n# Retrieving the Organization S for Physical Activity resource dict\norganization_s_json_dict = organization_s.create()\nprint(organization_s_json_dict)\n\n# Retrieve the Organization S for Physical Activity resource JSON string\nprint(json.dumps(organization_s_json_dict))\n```\n\n### Patient EX for Physical Activity example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import PatientEX\n\n\npatient_ex = PatientEX(str(uuid.uuid4()))\n\nprofile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/Patient-sport']\npatient_ex.set_profile_urls(profile_urls)\n\nextension_url = 'https://hapi.fhir.tw/fhir/StructureDefinition/person-age'\npatient_ex.set_extension_url(extension_url)\n\nextension_value_age = {\n    'value': 32,\n    'unit': '32',\n    'system': 'http://unitsofmeasure.org',\n    'code': 'a',\n}\npatient_ex.set_extension_value_age(extension_value_age)\n\nidentifiers = [{\n    'system': 'https://www.morefit.com.tw',\n    'value': '0938110330',\n}]\npatient_ex.set_identifiers(identifiers)\n\nname_text = '\u9023\u5c0f\u59b9'\npatient_ex.set_name_text(name_text)\n\ngender = 'female'\npatient_ex.set_gender(gender)\n\nbirth_date = '1990-01-01'\npatient_ex.set_birth_date(birth_date)\n\n# Retrieving the Patient EX for Physical Activity resource dict\npatient_ex_json_dict = patient_ex.create()\nprint(patient_ex_json_dict)\n\n# Retrieve the Patient EX for Physical Activity resource JSON string\nprint(json.dumps(patient_ex_json_dict))\n```\n\n### Patient TW for Physical Activity example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import PatientTW\n\n\npatient_tw = PatientTW(str(uuid.uuid4()))\n\nprofile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/TWCorePatient']\npatient_tw.set_profile_urls(profile_urls)\n\nextension_url = 'https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/person-age'\npatient_tw.set_extension_url(extension_url)\n\nextension_value_age = {\n    'value': 32,\n    'system': 'http://unitsofmeasure.org',\n    'code': 'a',\n}\npatient_tw.set_extension_value_age(extension_value_age)\n\nextension_extension_coding = [{\n    'system': 'urn:iso:std:iso:3166',\n    'code': 'TW',\n}]\npatient_tw.set_extension_extension_coding(extension_extension_coding)\n\nextension_extension_url = 'http://hl7.org/fhir/StructureDefinition/patient-nationality'\npatient_tw.set_extension_extension_url(extension_extension_url)\n\nidentifiers = [{\n    'use': 'official',\n    'type': {\n        'coding': [{\n            'system': 'http://terminology.hl7.org/CodeSystem/v2-0203',\n            'code': 'NNxxx',\n            '_code': {\n                'extension': [{\n                    'extension': [\n                        {\n                            'url': 'suffix',\n                            'valueString': 'TWN'\n                        },\n                        {\n                                'url': 'valueSet',\n                                'valueCanonical': 'http://hl7.org/fhir/ValueSet/iso3166-1-3'\n                        }\n                    ],\n                    'url': 'https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/identifier-suffix'\n                }]\n            }\n        }]\n    },\n    'system': 'http://www.moi.gov.tw',\n    'value': 'A123456789'\n}]\npatient_tw.set_identifiers(identifiers)\n\nactive = True\npatient_tw.set_active(active)\n\nname_user = 'official'\npatient_tw.set_name_use(name_use)\n\nname_text = '\u9023\u5c0f\u59b9'\npatient_tw.set_name_text(name_text)\n\ngender = 'female'\npatient_tw.set_gender(gender)\n\nbirth_date = '1990-01-01'\npatient_tw.set_birth_date(birth_date)\n\n# Retrieving the Patient TW for Physical Activity resource dict\npatient_tw_json_dict = patient_tw.create()\nprint(patient_tw_json_dict)\n\n# Retrieve the Patient TW for Physical Activity resource JSON string\nprint(json.dumps(patient_tw_json_dict))\n```\n\n### ServiceRequest for Physical Activity example (MITW 2024)\n\n```python\nimport json\nimport uuid\nfrom fhir_data_generator import PhysicalActivityServiceRequest\n\n\nservice_request = PhysicalActivityServiceRequest(str(uuid.uuid4()))\n\nprofile_urls = ['https://hapi.fhir.tw/fhir/StructureDefinition/ServiceRequest-sport']\nservice_request.set_profile_urls(profile_urls)\n\nidentifiers = [{\n    'system': 'https://www.health.ntpc.gov.tw/',\n    'value': 's141526',\n}]\nservice_request.set_identifiers(identifiers)\n\nstatus = 'completed'\nservice_request.set_status(status)\n\nintent = 'order'\nservice_request.set_intent(intent)\n\ncategory_coding = [{\n    'system': 'https://hapi.fhir.tw/fhir/CodeSystem/tempcode',\n    'code': 'PhysicalActivity',\n    'display': 'Physical Activity'\n}]\nservice_request.set_category_coding(category_coding)\n\ncode_coding = [{\n    'system': 'http://snomed.info/sct',\n    'code': '229065009',\n    'display': 'Exercise therapy',\n}]\nservice_request.set_code_coding(code_coding)\n\nsubject= {\n    'reference': 'Patient/patient-tw-example',\n}\nservice_request.set_subject(subject)\n\nauthored_on = '2024-07-01'\nservice_request.set_authored_on(authored_on)\n\nrequester = {\n    'reference': 'Practitioner/practitioner-d-example',\n}\nservice_request.set_requester(requester)\n\n# Retrieving the ServiceRequest for Physical Activity resource dict\nservice_request_json_dict = service_request.create()\nprint(service_request_json_dict)\n\n# Retrieve the ServiceRequest for Physical Activity resource JSON string\nprint(json.dumps(service_request_json_dict))\n```\n\n# References\n\n- https://hackersandslackers.com/python-poetry-package-manager\n- https://www.digitalocean.com/community/tutorials/how-to-publish-python-packages-to-pypi-using-poetry-on-ubuntu-22-04\n- https://www.freecodecamp.org/news/how-to-build-and-publish-python-packages-with-poetry\n- https://stackoverflow.com/questions/68882603/using-python-poetry-to-publish-to-test-pypi-org\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The quick FHIR data generator for Python.",
    "version": "1.6.1",
    "project_urls": {
        "Homepage": "https://github.com/peter279k/fhir-data-generator",
        "Repository": "https://github.com/peter279k/fhir-data-generator"
    },
    "split_keywords": [
        "fhir",
        " data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba5fe808d8c44e4a71fa2c5d6447060c9379249ef354ac6c32f83609256100ba",
                "md5": "f883c7f54de89d941eacfa9c574cf2be",
                "sha256": "c97690ebd76c68b8d1e76bcb2c7acf1ea59bfbbb58f59f0ee8eaafb924da438f"
            },
            "downloads": -1,
            "filename": "fhir_data_generator-1.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f883c7f54de89d941eacfa9c574cf2be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 40420,
            "upload_time": "2024-09-06T07:03:52",
            "upload_time_iso_8601": "2024-09-06T07:03:52.320098Z",
            "url": "https://files.pythonhosted.org/packages/ba/5f/e808d8c44e4a71fa2c5d6447060c9379249ef354ac6c32f83609256100ba/fhir_data_generator-1.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96dea7da2ed06a073a22a3b7f76ac4b6ffdc103579db1895b114fd6463646db3",
                "md5": "5809f22db91e4337ef87fbe5aea0fb27",
                "sha256": "e3fe595ed082285d562d1f44e703336f9350c36d15b6a954426aca29c59a8be1"
            },
            "downloads": -1,
            "filename": "fhir_data_generator-1.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5809f22db91e4337ef87fbe5aea0fb27",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 23700,
            "upload_time": "2024-09-06T07:03:53",
            "upload_time_iso_8601": "2024-09-06T07:03:53.708323Z",
            "url": "https://files.pythonhosted.org/packages/96/de/a7da2ed06a073a22a3b7f76ac4b6ffdc103579db1895b114fd6463646db3/fhir_data_generator-1.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-06 07:03:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "peter279k",
    "github_project": "fhir-data-generator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fhir-data-generator"
}
        
Elapsed time: 9.75079s