https://github.com/inferno-framework/dynamic-example-information
Project to generate example information dynamically based on a HL7 FHIR implementation guide!
https://github.com/inferno-framework/dynamic-example-information
Last synced: about 1 month ago
JSON representation
Project to generate example information dynamically based on a HL7 FHIR implementation guide!
- Host: GitHub
- URL: https://github.com/inferno-framework/dynamic-example-information
- Owner: inferno-framework
- Created: 2021-04-05T21:14:30.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-26T23:47:28.000Z (about 5 years ago)
- Last Synced: 2025-02-17T04:28:43.142Z (over 1 year ago)
- Language: Ruby
- Size: 12.1 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dynamic-example-information
Project to generate example information dynamically based on a HL7 FHIR implementation guide!
# Running the App
There is currently a single rake task maintained for running the application.
Cardinality options are max, min, or random. Max is generally the best option when testing the application.
```
# Running the application across US Core IG, creating 2 examples per resource, using the maximum cardinality allowed (with a ceiling of 3). 'lib/data/uscore' Must contain US Core package.
rake fhir_gen:run[uscore,2,max]
```
# Directories
1. lib: App code
2. lib/data: Contains any raw data sources that have been getting used during development. IG packages should be placed here, and their name fed into the rake task.
3. lib/faker/locales: Contains the YAML files used to populate Faker's values.
4. examples: Output for JSON representation of the created example. Current out is in the "pretty format".
5. logs: Logs any values that the application failed to fake.
# Class Files
1. fhir_gen.rb: Entry point for application
2. tasks.rake: CLI definitions for running the application.
3. structure_defition.rb - Wraps up a single resource example. StructureDefinition's always have 1 Fieldset.
4. field_set.rb - Does all the real work of building our resource's structure. Fieldsets have 0..* other fieldsets & fields.
5. field.rb - This class represents a terminal atomic value in our example. Has all of the data associated with a single snapshot element, and the value we decided to use as our fake data. All the logic for picking some fake data is currently in here.
# TODO:
1. Support for extensions.
2. Node name's with ':' in them cannot be faked
3. Node name's that share their name with a default Ruby Object method cannot be faked
4. Missing a few ValueSets
# Ruby Tips
1. Add a binding.pry anywhere in the code to stop execution and take a look.
1. 'exit' will continue execution
2. 'send :exit' will completely stop execution
2. Run 'bundle install' after a pull if you are having dependency issues. I added a Gemfile, which is the equivalent of a requirements.txt.