@andreacoombs1 ,我之前已經看到過這個請求。我們創建了一個粗略的腳本/JMP 臨床報告來執行類似的操作。我認為 BMS 也要求提供這份報告。
/*
Authors:
Andrea Coombs and Chris Kirchberg, JMP Statistical Discovery, LLC
Subject:
CTC Grade Adjudication Report based on DM, AE and LB domain data
ADaM version has yet to be confirmed
Summary:
Original Date of Creation:
May 5th, 2023
Original JMP Clinical Target Version:
17.2
Updated:
May 5th, 2023
Current Report Version:
1.1
Current JMP Clinical Target Version:
17.2
*/
Names Default To Here( 1 );
/*
Define the report to the report selector with the following attributes:
label, reportSelectorTab, drillDown, cdiscClass, icon and documentation
*/
processNS:label = "CTC Grade Adjudication";
processNS:reportSelectorTab = 1;
processNS:drillDown = 0;
processNS:cdiscClass = locale:get( "OtherEvents_Text" );
processNS:icon = "/install/clinical/documentation/icons/clinical/bar_chart_16p.png"; //Location/path for custom icon
processNS:documentation = jg:getReportHelpPath(); //Place holder for location of documentation/Help
//This will be called at report selection time to see if the report is supported
//The objRefNS object does not exist yet
//Definging required domains and variables
processNS:requirements = ["AE" => {{"USUBJID", "AEBODSYS", "AETOXGR", "AESTDY", "AEENDY", "AETERM"}, {"_ALL_"}}, "LB" => {{"USUBJID", "LBTEST",
"LBSTRESN", "LBDY"}, {"_ALL_"}}];
//Function to run report when adding report to review template with main code inside
processNS:runReport = Function( {},
{Default Local},
//Required to use loadData,....
Include( Convert File Path( "$CLINICAL_HOME/JSLFiles/DataPrep.JSL", absolute, windows ) );
//Get/load AE and LBdomain and set a reference to it.
objRefNS:aeDT = loadData( "AE" );
objRefNS:lbDT = loadData( "LB" );
// Clear row selection
objRefNS:aeDT << Clear Select;
// Subset data table
// → Data Table( "Subset of ae" )
objRefNS:subAEDT = objRefNS:aeDT << Select Where( :AEBODSYS == "BLOOD AND LYMPHATIC SYSTEM DISORDERS" | :AEBODSYS == "INVESTIGATIONS" ) <<
Subset( Invisible, Selected Rows( 1 ), Selected columns only( 0 ) );
// Close Data Table: ae
Close( objRefNS:aeDT, NoSave );
// Subset data table
// → Data Table( "Subset of lb" )
objRefNS:subLBDT = objRefNS:lbDT << Select Where( :LBTEST == "Hemoglobin" | :LBTEST == "Platelet" ) << Subset(
Invisible,
Selected Rows( 1 ),
Selected columns only( 0 )
);
// Close Data Table: lbx
Close( objRefNS:lbDT, NoSave );
// Split data table
// → Data Table( "Split LB" )
objRefNS:splitLBDT = objRefNS:subLBDT << Split(
Split By( :LBTEST ),
Split( :LBSTRESN ),
Group( :USUBJID, :LBDY ),
Output Table( "Split LB" ),
Remaining Columns( Drop All ),
Sort by Column Property,
Invisible
);
// Close Data Table: Subset of lb
Close( objRefNS:subLBDT, NoSave );
// New column: CTC Grade
objRefNS:splitLBDT << New Column( "CTC Grade",
Character,
"Nominal",
Formula(
If( !Is Missing( :Hemoglobin ) & !Is Missing( :Platelet ),
If(
:Hemoglobin > 17 | :Platelet > 600, 3,
15 < :Hemoglobin <= 17 | 400 < :Platelet <= 600, 2,
1
),
If( !Is Missing( :Hemoglobin ),
If(
:Hemoglobin > 17, 3,
15 < :Hemoglobin <= 17, 2,
1
),
If(
:Platelet > 600, 3,
400 < :Platelet <= 600, 2,
1
)
)
)
)
);
// Change column name: AETOXGR → CTC Grade
objRefNS:subAEDT:AETOXGR << Set Name( "CTC Grade" );
// Concatenate tables
// → Data Table( "CTC Grade Judication" )
objRefNS:ctcGrdAdDT = objRefNS:subAEDT << Concatenate( Invisible, objRefNS:splitLBDT, Output Table( "CTC Grade Adjudication" ) );
// Close Data Table: split of subset of lb
Close( objRefNS:splitLBDT, NoSave );
// Close Data Table: subset of ae
Close( objRefNS:subAEDT, NoSave );
//Link demography data to CTC Grade Adjudication table
report:linkAnalysisTableToADSLTable( objRefNS:ctcGrdAdDT );
processNS:setReportOutput(
objRefNS:resultsContainer = V List Box(
objRefNS:outBox1 = Outline Box( "Results",
// Report snapshot: CTC Grade Adjudication - Graph Builder
objRefNS:gb1 = objRefNS:ctcGrdAdDT << Graph Builder(
Size( 518, 714 ),
Show Control Panel( 0 ),
Variables(
X( :AESTDY ),
X( :AEENDY, Position( 1 ) ),
X( :LBDY, Position( 1 ) ),
Y( :AETERM ),
Y( :Hemoglobin ),
Y( :Platelet ),
Color( :CTC Grade )
),
Elements( Position( 1, 1 ), Points( X( 1 ), X( 2 ), Y, Legend( 23 ) ) ),
Elements( Position( 1, 2 ), Line( X( 3 ), Y, Legend( 27 ) ), Points( X( 3 ), Y, Legend( 29 ) ) ),
Elements( Position( 1, 3 ), Line( X( 3 ), Y, Legend( 26 ) ), Points( X( 3 ), Y, Legend( 28 ) ) ),
/* Local Data Filter(
Add Filter( columns( :USUBJID ), Where( :USUBJID == "21031" ), Display( :USUBJID, N Items( 15 ), Find( Set Text( "" ) ) ) )
),*/
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
23,
Properties( 0, {Line Color( 4 )}, Item ID( "1", 1 ) ),
Properties( 1, {Line Color( 9 )}, Item ID( "2", 1 ) ),
Properties( 2, {Marker( "Filled Right Triangle" )}, Item ID( "AESTDY", 1 ) ),
Properties( 3, {Marker( "Filled Left Triangle" )}, Item ID( "AEENDY", 1 ) ),
Properties( -1, {Line Color( 3 )}, Item ID( "3", 1 ) )
), Legend Model(
27,
Properties( 0, {Line Color( 32 )}, Item ID( "1", 1 ) ),
Properties( 1, {Line Color( 32 )}, Item ID( "2", 1 ) ),
Properties( -1, {Line Color( 32 )}, Item ID( "3", 1 ) )
), Legend Model(
29,
Base( 0, 0, 0, Item ID( "1", 1 ) ),
Base( 1, 0, 1, Item ID( "2", 1 ) ),
Properties( 0, {Line Color( 4 )}, Item ID( "1", 1 ) ),
Properties( 1, {Line Color( 9 )}, Item ID( "2", 1 ) ),
Base( -1, 0, 2, Item ID( "3", 1 ) ),
Properties( -1, {Line Color( 3 )}, Item ID( "3", 1 ) )
), Legend Model(
26,
Base( 0, 0, 0, Item ID( "1", 1 ) ),
Base( 1, 0, 1, Item ID( "2", 1 ) ),
Properties( 0, {Line Color( 32 )}, Item ID( "1", 1 ) ),
Properties( 1, {Line Color( 32 )}, Item ID( "2", 1 ) ),
Base( -1, 0, 2, Item ID( "3", 1 ) ),
Properties( -1, {Line Color( 32 )}, Item ID( "3", 1 ) )
), Legend Model(
28,
Base( 0, 0, 0, Item ID( "1", 1 ) ),
Base( 1, 0, 1, Item ID( "2", 1 ) ),
Properties( 0, {Line Color( 4 )}, Item ID( "1", 1 ) ),
Properties( 1, {Line Color( 9 )}, Item ID( "2", 1 ) ),
Base( -1, 0, 2, Item ID( "3", 1 ) ),
Properties( -1, {Line Color( 3 )}, Item ID( "3", 1 ) )
)}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {23, [0, 1, 2, 3], 27, [-1, -1], 29, [-1, -1], 26, [-1, -1], 28, [-1, -1]} )}
)
)
)
)
)
);
//Display data tables created or used in this report
processNS:addDataTableReference( "CTC Grade Adjudication Table", "objRefNS:ctcGrdAdDT" );
);
// return code
0;