{"id":21832946,"url":"https://github.com/null-none/fhir-faker","last_synced_at":"2025-04-14T07:37:45.869Z","repository":{"id":57429200,"uuid":"427966283","full_name":"null-none/fhir-faker","owner":"null-none","description":"A library for generating fake FHIR resources and data types.","archived":false,"fork":false,"pushed_at":"2021-12-12T15:25:53.000Z","size":65,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T21:12:02.574Z","etag":null,"topics":["fhir","fhir-client","fhir-server","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/null-none.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-14T15:30:25.000Z","updated_at":"2025-03-02T09:28:51.000Z","dependencies_parsed_at":"2022-08-27T17:00:53.377Z","dependency_job_id":null,"html_url":"https://github.com/null-none/fhir-faker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null-none%2Ffhir-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null-none%2Ffhir-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null-none%2Ffhir-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/null-none%2Ffhir-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/null-none","download_url":"https://codeload.github.com/null-none/fhir-faker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248840574,"owners_count":21170019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fhir","fhir-client","fhir-server","python"],"created_at":"2024-11-27T19:27:16.492Z","updated_at":"2025-04-14T07:37:45.839Z","avatar_url":"https://github.com/null-none.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fhir-faker\nA library for generating fake FHIR resources and datatypes\n\n#### Install \n```bash\npip install fhir-faker\n```\n\n#### Examples\n\n```python\n# Data types\n\nfrom fhir_faker.fake import FakeFHIR\n\nfake = FakeFHIR()\n\n# return data types list\nprint(fake.data_types)\n# ['human_name', 'period', 'address']\n\n# return HumanName data type\nprint(fake.human_name().serialize())\n# {'use': 'anonymous', 'suffix': [u'MD'], 'family': u'Walters', 'text': u'Edward Smith', 'given': u'David', 'period': {'start': datetime.date(2009, 2, 1), 'end': datetime.date(2021, 11, 14)}, 'prefix': [u'Mr.']}\n\n\n# return HumanName attributes\nprint(fake.human_name().attributes())\n# {'given': \"['\u003cstring\u003e'], // Given names (not always 'first'). Includes middle names\", 'suffix': \"['\u003cstring\u003e''], // Parts that come after the name\", 'family': \"'\u003cstring\u003e', // Family name (often called 'Surname')\", 'text': \"'\u003cstring\u003e', // Text representation of the full name\", 'period': '{ Period } // Time period when name was/is in use', 'prefix': \"['\u003cstring\u003e'], // Parts that come before the name\", 'use:': \"'\u003ccode\u003e' // usual | official | temp | nickname | anonymous | old | maiden\"}\n\n\n# update key value data for HumanName data type\nprint(fake.human_name().update({\"use\": \"temp\"}))\n# {'use': 'temp', 'suffix': [u'MD'], 'family': u'Williams', 'text': u'Anthony Adams', 'given': u'Michael', 'period': {'start': datetime.date(1967, 7, 12), 'end': datetime.date(2021, 11, 14)}, 'prefix': [u'Mr.']}\n\n```\n\n\n```python\n# Resources\n\nfrom fhir_faker.fake import FakeFHIR\n\nfake = FakeFHIR()\n# return resources list\nprint(fake.resources)\n# [\"patient\", \"organization\"]\n\n# return Patient resource\nprint(fake.patient().serialize())\n# {'managingOrganization': {'resourceType': 'Organization', 'active': False, 'identifier': '745fba5058bf4351abbe02e8f4276365', 'name': u'Glenn Group'}, 'name': [{'use': 'maiden', 'suffix': [u'Jr.'], 'family': u'Sanford', 'text': u'Matthew Todd PhD', 'given': u'Gary', 'period': {'start': datetime.date(2000, 6, 18), 'end': datetime.date(2021, 11, 14)}, 'prefix': [u'Dr.']}], 'resourceType': 'Patient', 'birthDate': datetime.date(1993, 8, 24), 'address': [{'city': u'Johnsonside', 'use': 'temp', 'district': u'bury', 'text': u'PSC 1292, Box 4906\\nAPO AE 46449', 'period': {'start': datetime.date(1988, 12, 9), 'end': datetime.date(2021, 11, 14)}, 'state': u'haven', 'country': u'Congo', 'postalCode': u'41762', 'line': [u'6676 Lisa Fords Suite 341'], 'type': 'both'}], 'active': True, 'identifier': 'ec558e77780048608cefdab7f8f0c0e7'}\n\n# return Patient resource\nprint(fake.patient(sex=\"male\").serialize())\n# {'managingOrganization': {'resourceType': 'Organization', 'active': True, 'identifier': 'ec4c3594b0af49008b1f674dc5e59c8f', 'name': u'Ramirez-Lowe'}, 'name': [{'use': 'maiden', 'suffix': [u'Jr.'], 'family': u'Rivers', 'text': u'Carlos Ruiz', 'given': u'Joseph', 'period': {'start': datetime.date(2008, 1, 28), 'end': datetime.date(2021, 11, 14)}, 'prefix': [u'Mr.']}], 'resourceType': 'Patient', 'birthDate': datetime.date(1919, 4, 5), 'address': [{'city': u'East Kristinaburgh', 'use': 'billing', 'district': u'side', 'text': u'081 Lawrence Street Suite 400\\nJessicaton, NE 41331', 'period': {'start': datetime.date(1989, 8, 13), 'end': datetime.date(2021, 11, 14)}, 'state': u'haven', 'country': u'Dominica', 'postalCode': u'31375', 'line': [u'142 Tiffany Cliff'], 'type': 'physical'}], 'active': True, 'identifier': '981a82f2cbc3438a8427093ac4209542'}\n\n# return Patient resource\nprint(fake.patient(sex=\"female\").serialize())\n# {'managingOrganization': {'resourceType': 'Organization', 'active': False, 'identifier': 'b37d040b05104033bfda2502737f9763', 'name': u'Hogan, Clark and Lee'}, 'name': [{'use': 'maiden', 'suffix': [u'MD'], 'family': u'Hines', 'text': u'Kara York', 'given': u'Jennifer', 'period': {'start': datetime.date(2014, 2, 28), 'end': datetime.date(2021, 11, 14)}, 'prefix': [u'Mrs.']}], 'resourceType': 'Patient', 'birthDate': datetime.date(2007, 7, 27), 'address': [{'city': u'East Bradley', 'use': 'temp', 'district': u'bury', 'text': u'7683 Monique Square\\nSouth Elizabethborough, HI 30811', 'period': {'start': datetime.date(1983, 4, 18), 'end': datetime.date(2021, 11, 14)}, 'state': u'stad', 'country': u'Saint Martin', 'postalCode': u'34715', 'line': [u'196 Megan Trail Suite 418'], 'type': 'physical'}], 'active': True, 'identifier': '3ab6baf23fda449bbbba83098f380753'}\n\n```\n\n\n```python\n# Locale\n\nfrom fhir_faker.fake import FakeFHIR\n\nfake = FakeFHIR(locale=\"it_IT\")\nprint(fake.patient().serialize())\n# {'managingOrganization': {'resourceType': 'Organization', 'active': True, 'identifier': '5d1890fcd4db404a9df4f3dadeb4f46f', 'name': u'Gadda, Bellucci e Muratori s.r.l.'}, 'name': [{'use': 'maiden', 'suffix': [u''], 'family': u'Ovadia', 'text': u'Sabatino Mastandrea', 'given': u'Pasqual', 'period': {'start': datetime.date(1961, 8, 15), 'end': datetime.date(2021, 11, 14)}, 'prefix': [u'Sig.']}], 'resourceType': 'Patient', 'birthDate': datetime.date(1916, 12, 10), 'address': [{'city': u'Taliani del friuli', 'use': 'work', 'district': u'umbro', 'text': u\"Rotonda Sandro 95 Appartamento 70\\nDisdero nell'emilia, 38280 Trento (SR)\", 'period': {'start': datetime.date(1965, 3, 10), 'end': datetime.date(2021, 11, 14)}, 'state': u'umbro', 'country': u'Somalia', 'postalCode': u'97135', 'line': [u'Borgo Baglioni 2'], 'type': 'both'}], 'active': True, 'identifier': 'c221a4a07fab4202bf2198756bba1966'}\nprint(fake.address().serialize())\n# {'city': u'Borgo Silvia umbro', 'use': 'old', 'district': u'terme', 'text': u'Stretto Pininfarina 076\\nEmilio salentino, 86563 Benevento (AO)', 'period': {'start': datetime.date(2014, 3, 19), 'end': datetime.date(2021, 11, 14)}, 'state': u'lido', 'country': u'Italy', 'postalCode': u'48118', 'line': [u'Via Baroffio 9'], 'type': 'both'}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnull-none%2Ffhir-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnull-none%2Ffhir-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnull-none%2Ffhir-faker/lists"}