cdisc-org / conformance-rules-editor

MIT License
6 stars 3 forks source link

Export button to automate report generation #175

Closed gerrycampion closed 5 months ago

gerrycampion commented 1 year ago

AC: Export button

  1. executes the following query:
    SELECT DISTINCT
    Rule["Core"]["Id"] ?? null as "CORE-ID",
    udf.TO_STRING(ARRAY(SELECT DISTINCT VALUE Reference["Rule_Identifier"]["Id"] FROM Authority IN Rule["Authorities"] JOIN Standard IN Authority["Standards"] JOIN Reference IN Standard["References"])) as "CDISC Rule ID",
    Rule["Outcome"]["Message"] ?? null as "Error Message",
    Rule["Description"] ?? null as "Description",
    udf.TO_STRING(ARRAY(SELECT DISTINCT VALUE Authority["Organization"] FROM Authority IN Rule["Authorities"])) as "Organization",
    udf.TO_STRING(ARRAY(SELECT DISTINCT VALUE Standard["Name"] FROM Authority IN Rule["Authorities"] JOIN Standard IN Authority["Standards"])) as "Standard Name",
    udf.TO_STRING(ARRAY(SELECT DISTINCT VALUE Standard["Version"] FROM Authority IN Rule["Authorities"] JOIN Standard IN Authority["Standards"])) as "Standard Version",
    Rule["Executability"] ?? null as "Executability",
    Rule["Core"]["Status"] ?? null as "Status"
    FROM Rules["json"] as Rule
    ORDER BY Rule["Core"]["Id"] ASC
  2. Ensure all pages of records are retrieved
  3. Add quotes to cells to avoid issues when cells begin with "="
  4. Convert to Excel file