cdisc-org / cdisc-rules-engine

Open source offering of the cdisc rules engine
MIT License
46 stars 12 forks source link

35 support usdm data source in engine #614

Closed gerrycampion closed 6 months ago

gerrycampion commented 7 months ago

A new USDMDataService and USDMJSONReader is implemented to support reading USDM json files. The service converts a single json file to a set of datasets. Given JSON, a new dataset record is created at the root, for each unique item within a list, and for each property value. If a list item contains an object, that object becomes a new record within the parent's entity dataset and it becomes a new record within its own entity dataset. In addition to the recursive object properties, each record contains the following meta variables:

get_datasets was added to the dataservice interface and moved from utilities to individual dataservices, since it is handled differently within each dataservice.

Refer to the unit tests for examples. USDM_EliLilly_NCT03421379_Diabetes.json was taken from the DDF repo and is being used as test data. USDM.yaml converts property names found in the test file to entity names. This may need to be updated. Soon, this will be obsolete when we support USDM version 2-9-0 or later which requires an instanceType property for all objects.

ASL-rmarshall commented 6 months ago

@gerrycampion While trying to get the CLI to work for the DDF rules, I found that there were a few things that didn't work quite right for the USDM data service and its interactions with other components. These were things that I didn't really look at or during my initial review (mainly because I didn't know what they were for). I have applied some "quick-and-dirty" fixes in my local clone to get the CLI to work more-or-less as expected (see below), and I think it would be good for these to be pushed here. What's the best way to do this - restore this branch or create a new one?

Updates I've made include:

FYI @nickdedonder @drewcdisc @RamilCDISC

RamilCDISC commented 6 months ago

All the changes described by @ASL-rmarshall are pretty good. These will allow me to validate if usdm data is being properly converted without any additional test resources. Also covering the cases so code does not fall over will improve the code quality. Looking forward to the changed code. Once we have it I can conclude the validation for this issue 35.

@nickdedonder @drewcdisc

ASL-rmarshall commented 5 months ago

@gerrycampion @RamilCDISC I have restored the 35-support-usdm-data-source-in-engine branch and have drafted PR #631 with the additional changes described above.