atorus-research / datasetjson

Read and write CDISC Dataset JSON files
https://atorus-research.github.io/datasetjson/
Apache License 2.0
12 stars 2 forks source link

Enhancement request for write dataset json #34

Open wangw106 opened 3 months ago

wangw106 commented 3 months ago

Background Information

Thanks for providing this package. Can a new function on top of write_dataset_json be added to convert a study package to json files by taking care of the metadata population by reading it from the define.xml file?

Given an example in SEND, a SEND package has xpt files (ts.xpt, ta.xpt, bw.xpt,lb.xpt....) and define.xml file for the study, if a user wants to convert the xpt files to json files for the study, an easy way is to read the data from xpt files and read the metadata from the define.xml. Can a write function or convert function be provided as this: Take the input of the folder name include the SEND packages, also take the folder name as the json files output, read each xpt file under the input folder, read the xml file under the input folder as metadata, convert the package using the data and metadata. write the converted json files to the json folder specified. This is similar for SDTM and ADAM packages.

Definition of Done

No response