Auto-generating the type definitions
Example usage
julia> using Generate
julia> fhir_version = :R4
:R4
julia> url = "https://www.hl7.org/fhir/$(fhir_version)/definitions.json.zip"
"https://www.hl7.org/fhir/R4/definitions.json.zip"
julia> json_definitions = Generate.download_fhir_json_schema(url);
julia> schema_string = json_definitions["fhir.schema.json.zip"]["fhir.schema.json"];
julia> output_file = "autogenerated-$(fhir_version).jl"
"autogenerated-R4.jl"
julia> Generate.output_fhir_types(; schema_string = schema_string, output_file = output_file)
[ Info: Successfully wrote content to: /home/runner/work/FHIRClient.jl/FHIRClient.jl/docs/build/autogenerated-R4.jl "/home/runner/work/FHIRClient.jl/FHIRClient.jl/docs/build/autogenerated-R4.jl"
Index
Docs
Generate.download_fhir_json_schema
— Methoddownload_fhir_json_schema(url::AbstractString)
Download and unzip the file at url
.
Example
julia> url = "https://www.hl7.org/fhir/R4/definitions.json.zip"
julia> Generate.download_fhir_json_schema(url)
Generate.output_fhir_types
— Methodoutput_fhir_types(; output_file, schema_string)
Generate the FHIR types and save them in the specified output file.