NEWS.md
read_bds() producing duplicate (age, yname) rows in xy when the same varName-keyed item (e.g. a gs1/D-score milestone) was picked up independently by both the generic sideload mechanism (sideload_variables(), Step 10b) and the ddi/var append (convert_var_gsed_3(), Step 11) – both paths read the same clientMeasurements rows without deduplicating against each other. This broke any downstream dplyr::summarise()/pivot_wider() expecting one row per (age, yname) (e.g. dscore’s adaptive-testing pipeline via dcat()), which errored on the resulting list-column.distinct(age, yname, .keep_all = TRUE) Step 10b already used, keeping the first (bdsNumber/ddi-derived) occurrence and dropping a redundant sideloaded duplicate for the same visit. Known limitation, unchanged from Step 10b’s existing behavior: if the same item genuinely has two different values at (nearly) the same computed age – not a redundant resend, but an actual repeat measurement on the same day – only the first is kept; this was already true for the sideload path and is not a new restriction introduced by this fix.gen), 315 (pubic hair, boy, phb), 317 (breast development, bre), 825 (pubic hair, girl, phg) and 312 (date of menarche, stored as psn$mendate).varName sideload mechanism into read_bds()’s xyz output (previously computed but never merged). All six pubertal types (gen, phb, bre, phg, men, tv) can be supplied via varName sideload; gen/phb/bre/phg can also be supplied via their official bdsNumber. tv (testicular volume) and men (staged menarche indicator) have no BDS equivalent and remain varName-only. Where both a bdsNumber and a sideloaded varName supply the same (age, yname), the bdsNumber-derived value wins.phb/phg; since the tanner package’s reference tables only tabulate stages 1-5, P6 is recoded to stage 5 before use.check_ranges_3() bug where a clientMeasurements entry with type == "date" (i.e. a date-valued reading, as introduced for BDS 312) had its value silently overwritten by the visit date whenever both were present. Such entries now use a distinct valuedate type/column.gen/phb/bre/phg/men/tv are excluded from nlreferences::set_refcodes()/y2z() z-scoring (nlreferences does not yet recognize these codes); their z/zname/zref stay NA. SDS for these is computed downstream via tanner::calculate_sds().mendate (date of menarche) to psn.ddi and gs1 instrument data.data$var syntax in tidyselect functionsvarName in addition to bdsNumber, bypassing BDS restrictions. In its current implementation it will only work for time data. It is extendible to other measurement instruments for child development.bds_v3.1.json.append_ddi argument with append, which can take a vector of strings indicating which measurement instruments to append to the data (default is ‘ddi’).$id element to a more elegant URL: james.groeidiagrammen.nl/schemas
dscore from CRAN instead of GitHubjamesdemodata
read_bds() function return an object of class bdsreader
bdsreader class at the end of read_bds()
print function for bdsreader classinst/examples to the jamesdemodata package, but keep the folder for backward compatibilityinst/schema/bds_v3.0.json to point to master branchinst/examples/maria.json by an older versioninteger to number
read_bds() and write_bds() for
write_bds()
dplyr::case_match() by requiring dplyr 1.1.0
bdsreader packageread_bds() into 13 stepsvalidate to read_bds() can bypass the jsonvalidate::json_validate() to speed up data reading. The default is FALSE. Use validate = TRUE to obtain diagnostic information.read_bds() now writes intermediate JSON file to the working directory by setting intermediate = TRUE.read_bds() according to major version numberwrite_bds() that failed to save gestational age for lollypop datawrite_bds() in subfunctions per major versionread_bds() to cover three major versionswrite_bds() so that it conforms to JSON BDS schema V3.0switch() statementname and src are properly read for V1.0-V3.0 dataparse_valid() robust against BDS sequencewrite_bds() to JSON schema V3.0read_bds() and write_bds()
dscore(..., key = "gsed2212")
maria and examples/maria.json
target, so now the target data is just a list with elements named "psn" and "xyz".read_bds() from “tibble with attribute” to an object of class target. This will provide a complete export of the data when converted into JSON format.jsonlite::FROMjson(), which errors on alien argument namesminidata for demo purposesexport_as_bds() that converts donordata into JSON filesjsonvalidate outputparse_valid() that does not work under format 2.0bds_v2.0.json as detected by jsonvalidate::json_validate()
jsonvalidate::json_validate()
auto_format that stores the format in the data file (#2)jamesdemodata package for testing and demo’sinst/examples
maria1.json and maria2.json
This is a major update that introduces schema versioning for JAMES. Schema versioning allows input data to be formatted according to one of multiple JSON-schemas.
read_bds(), write_bds() and related functions;format the most prominent user-facing argument. Alternatively, the user can also specify the schema file directly using the schema argument;bds_v{x.y}.json;bds_schema_str.json –> bds_v1.0.json (format = 1)bds_schema.json –> bds_v1.1.json
bds_schema_V2.json – bds_v2.0.json (format = 2)inst/json to inst/schemas;$id field in the schema’s to their permanent locations.The default is format = 2L, which is incompatible with early users who code their data with bds_schema_str.json. To read/write with the older format, call read_bds(..., format = 1L) or write_bds(..., format = 1L). The schema argument is primarily meant for development and testing.
pkgdown
R-CMD-check
docs folder by gh-pages branchbds_schema_v1.1.json as default!! (not all testfile yet work)jamestest package by jamesdemodata
bds_schema_v1.0.json (old) and bds_schema_v1.1.json (new)file argument to write_bds()
bds_write() functionbds_schema_v1.1.json
bds_schema_v1.1.json
bdsreader packagepersondata()
NEWS.md file to track changes to the package