Skip to content

Commit 2225ee9

Browse files
authored
In the struct docstring, list the original OMOP name as well as the Julia name (#20)
1 parent eada3be commit 2225ee9

3 files changed

Lines changed: 169 additions & 2 deletions

File tree

src/Generate/generate-types.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ end
6868
make_all_fields_optional::Bool)::String where F
6969
m = match(pattern, str)
7070
omopname = m[1]
71+
_omopname = strip(omopname)
72+
_omopname_lowercase = lowercase(_omopname)
73+
_omopname_uppercase = uppercase(_omopname)
7174
@debug("Attempting to create a Julia type for the OMOP CDM table \"$(omopname)\"")
72-
structname = string_casing(omopname)
75+
structname = string_casing(_omopname)
7376
fields = String[]
7477
fieldcontentsraw = m[2]
7578
lines = strip.(split(strip(fieldcontentsraw), "\n"))
@@ -82,10 +85,15 @@ end
8285
end
8386
end
8487
export_statement = _generate_export_statement(structname, export_structs)
88+
8589
output_lines = vcat(
8690
String[export_statement],
8791
String[""],
8892
String["\"\"\""],
93+
String["OMOP table name: $(_omopname)"],
94+
String[""],
95+
String["Julia struct name: $(structname)"],
96+
String[""],
8997
String["\$(DocStringExtensions.TYPEDEF)"],
9098
String["\$(DocStringExtensions.TYPEDFIELDS)"],
9199
String["\"\"\""],

0 commit comments

Comments
 (0)