{"id":16195058,"url":"https://github.com/chgl/fhirparametersgenerator","last_synced_at":"2025-03-22T05:19:00.543Z","repository":{"id":37462065,"uuid":"466276564","full_name":"chgl/FhirParametersGenerator","owner":"chgl","description":"A .NET source generator for mapping model classes to HL7 FHIR® Parameters resources.","archived":false,"fork":false,"pushed_at":"2024-05-25T06:54:52.000Z","size":212,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-28T00:39:38.014Z","etag":null,"topics":["csharp","csharp-sourcegenerator","dotnet","fhir"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chgl.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-04T21:34:14.000Z","updated_at":"2024-05-30T01:08:35.352Z","dependencies_parsed_at":"2023-02-17T03:55:31.622Z","dependency_job_id":"a7b4b426-0c55-4f24-957e-7c4a7fbabab5","html_url":"https://github.com/chgl/FhirParametersGenerator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl%2FFhirParametersGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl%2FFhirParametersGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl%2FFhirParametersGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl%2FFhirParametersGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chgl","download_url":"https://codeload.github.com/chgl/FhirParametersGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244357474,"owners_count":20440335,"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":["csharp","csharp-sourcegenerator","dotnet","fhir"],"created_at":"2024-10-10T08:26:02.652Z","updated_at":"2025-03-19T04:30:50.892Z","avatar_url":"https://github.com/chgl.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FhirParametersGenerator\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"100\" src=\"icon.png\" alt=\"FhirParametersGenerator Logo\"\u003e\u003c/p\u003e\n\n[![Build Status](https://github.com/chgl/FhirParametersGenerator/workflows/ci/badge.svg?branch=master)](https://github.com/chgl/FhirParametersGenerator/actions) [![NuGet](https://img.shields.io/nuget/v/FhirParametersGenerator.svg)](https://www.nuget.org/packages/FhirParametersGenerator/)\n\nA PoC .NET source generator for mapping model classes to HL7 FHIR® Parameters resources.\n\nUseful when interacting with FHIR® server operation endpoints.\n\n## Getting Started\n\n```sh\ndotnet add package FhirParametersGenerator\n```\n\nThis sample code...\n\n```cs\nusing FhirParametersGenerator;\nusing Hl7.Fhir.Model;\nusing Hl7.Fhir.Serialization;\n\nvar t = new TestModel\n{\n    Age = 123,\n    Name = \"Test\",\n    Code = new(\"http://snomed.info/sct\", \"386661006\", \"Fever\"),\n};\n\n// the ToFhirParameters() extension method is code-generated\nvar parameters = t.ToFhirParameters();\n\nConsole.WriteLine(parameters.ToJson(new() { Pretty = true }));\n\n// apply this attribute to the desired model class\n[GenerateFhirParameters]\npublic class TestModel\n{\n    public string Name { get; init; } = string.Empty;\n    public int Age { get; init; } = 0;\n    public CodeableConcept? Code { get; init; }\n}\n```\n\n...will output:\n\n```json\n{\n  \"resourceType\": \"Parameters\",\n  \"parameter\": [\n    {\n      \"name\": \"name\",\n      \"valueString\": \"Test\"\n    },\n    {\n      \"name\": \"age\",\n      \"valueDecimal\": 123\n    },\n    {\n      \"name\": \"code\",\n      \"valueCodeableConcept\": {\n        \"coding\": [\n          {\n            \"system\": \"http://snomed.info/sct\",\n            \"code\": \"386661006\"\n          }\n        ],\n        \"text\": \"Fever\"\n      }\n    }\n  ]\n}\n```\n\n## Limitations\n\nThis library is in a very early stage and many edge and not-so-edge cases that are not covered by the generated source.\nThe list of open issues is a good starting point to see what isn't yet supported. Contributions are of course always welcome.\n\n## Benchmark\n\nA benchmark project exists which measures the performance of generating the source code for a 1000-property class: \u003chttps://github.com/chgl/FhirParametersGenerator/blob/master/src/FhirParametersGenerator.Benchmark/Program.cs\u003e.\n\nBenchmarking results over time are available at \u003chttps://chgl.github.io/FhirParametersGenerator/dev/bench/\u003e.\n\n## Credits\n\n### Source Code\n\nContains source code published under the terms of the MIT license originally from \u003chttps://github.com/andrewlock/NetEscapades.EnumGenerators/\u003e and from \u003chttps://github.com/dotnet/runtime/blob/v6.0.2/src/libraries/System.Text.Json/Common/JsonCamelCaseNamingPolicy.cs\u003e.\n\n### Icon\n\nThe package icon is composed of\n\n- Fire by artworkbean from NounProject.com\n- Edit by Logan from NounProject.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchgl%2Ffhirparametersgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchgl%2Ffhirparametersgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchgl%2Ffhirparametersgenerator/lists"}