Skip to content

Commit

Permalink
updated compats
Browse files Browse the repository at this point in the history
  • Loading branch information
cecoeco committed Jul 30, 2024
1 parent c5ca6e8 commit 5aeed02
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 52 deletions.
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Transformers = "21ca0261-441d-5938-ace7-c90938fde4d4"

[compat]
CSV = "0.10"
DataFrames = "1.6"
DataStructures = "0.18"
HTMLTables = "0.4"
Graphviz_jll = "2"
LinearAlgebra = "1"
Poppler_jll = "24"
Statistics = "1"
Transformers = "0.3"
XLSX = "0.10"
julia = "1"

[extras]
Expand Down
70 changes: 35 additions & 35 deletions app/frontend/src/pages/flow_diagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,192 +133,192 @@ export default function FlowDiagram() {
const boxes = [
{
box_num: 1,
box_lab: "Previous studies",
box_text: "Previous studies",
results: null,
},
{
box_num: 2,
box_lab: "Identification of new studies via databases and registers",
box_text: "Identification of new studies via databases and registers",
results: null,
},
{
box_num: 3,
box_lab: "Identification of new studies via other methods",
box_text: "Identification of new studies via other methods",
results: null,
},
{
box_num: 4,
box_lab: "Identification",
box_text: "Identification",
results: null,
},
{
box_num: 5,
box_lab: "Screening",
box_text: "Screening",
results: null,
},
{
box_num: 6,
box_lab: "Included",
box_text: "Included",
results: null,
},
{
box_num: 7,
box_lab: "Studies included in previous version of review",
box_text: "Studies included in previous version of review",
results: state().data.numberOfPreviousStudies,
},
{
box_num: 7,
box_lab: "Reports of studies included in previous version of review",
box_text: "Reports of studies included in previous version of review",
results: state().data.numberOfPreviousReports,
},
{
box_num: 8,
box_lab: "Records identified from:",
box_text: "Records identified from:",
results: null,
},
];

state().databases.forEach((database) => {
boxes.push({
box_num: 8,
box_lab: database.name,
box_text: database.name,
results: database.value,
});
});

boxes.push(
{
box_num: 9,
box_lab: "Records removed before screening:",
box_text: "Records removed before screening:",
results: null,
},
{
box_num: 9,
box_lab: "Duplicate records removed",
box_text: "Duplicate records removed",
results: state().data.numberOfDuplicatesRemoved,
},
{
box_num: 9,
box_lab: "Records marked as ineligible by automation tools",
box_text: "Records marked as ineligible by automation tools",
results: state().data.numberOfAutomaticallyExcluded,
},
{
box_num: 9,
box_lab: "Records removed for other reasons",
box_text: "Records removed for other reasons",
results: state().data.numberOfRemovedForOtherReasons,
},
{
box_num: 10,
box_lab: "Records screened",
box_text: "Records screened",
results: state().data.numberOfRecordsScreened,
},
{
box_num: 11,
box_lab: "Records excluded",
box_text: "Records excluded",
results: state().data.numberOfRecordsExcluded,
},
{
box_num: 12,
box_lab: "Reports sought for retrieval",
box_text: "Reports sought for retrieval",
results: state().data.numberOfReportsSought,
},
{
box_num: 13,
box_lab: "Reports not retrieved",
box_text: "Reports not retrieved",
results: state().data.numberOfReportsNotRetrieved,
},
{
box_num: 14,
box_lab: "Reports assessed for eligibility",
box_text: "Reports assessed for eligibility",
results: state().data.numberOfReportsAssessed,
},
{
box_num: 15,
box_lab: "Reports excluded:",
box_text: "Reports excluded:",
results: null,
}
);

state().reasons.forEach((reason) => {
boxes.push({
box_num: 15,
box_lab: reason.name,
box_text: reason.name,
results: reason.value,
});
});

boxes.push(
{
box_num: 16,
box_lab: "New studies included in review",
box_text: "New studies included in review",
results: state().data.newStudies,
},
{
box_num: 16,
box_lab: "Reports of new included studies",
box_text: "Reports of new included studies",
results: state().data.newReports,
},
{
box_num: 17,
box_lab: "Total studies included in review",
box_text: "Total studies included in review",
results: state().data.totalStudies,
},
{
box_num: 17,
box_lab: "Reports of total included studies",
box_text: "Reports of total included studies",
results: state().data.totalReports,
},
{
box_num: 18,
box_lab: "Records identified from:",
box_text: "Records identified from:",
results: null,
},
{
box_num: 18,
box_lab: "Websites",
box_text: "Websites",
results: state().data.numberOfWebsites,
},
{
box_num: 18,
box_lab: "Organizations",
box_text: "Organizations",
results: state().data.numberOfOrganizations,
},
{
box_num: 18,
box_lab: "Citation searching",
box_text: "Citation searching",
results: state().data.numberOfCitations,
},
{
box_num: 18,
box_lab: "Other",
box_text: "Other",
results: state().data.numberOfOtherSources,
},
{
box_num: 19,
box_lab: "Reports sought for retrieval",
box_text: "Reports sought for retrieval",
results: state().data.numberOfReportsSought,
},
{
box_num: 20,
box_lab: "Reports not retrieved",
box_text: "Reports not retrieved",
results: state().data.numberOfReportsNotRetrieved,
},
{
box_num: 21,
box_lab: "Reports assessed for eligibility",
box_text: "Reports assessed for eligibility",
results: state().data.numberOfReportsAssessed,
},
{
box_num: 22,
box_lab: "Reports excluded:",
box_text: "Reports excluded:",
results: null,
}
);

state().otherReasons.forEach((reason) => {
boxes.push({
box_num: 22,
box_lab: reason.name,
box_text: reason.name,
results: reason.value,
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/checklist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ completed checklist along with the paper's metadata, represented by the type `Ch
"""
function checklist_df()::DataFrame
cols::Vector{String} = ["Section and Topic","Item #","Checklist Item","Location where item is reported"]
cols::Vector{String} = ["Section and Topic", "Item #", "Checklist Item", "Location where item is reported"]
rows::Vector{Tuple{String,String,String,String}} = [
("TITLE", "", "", ""),
("Title", "1", "Identify the report as a systematic review", ""),
Expand Down
35 changes: 19 additions & 16 deletions src/flow_diagram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ PRISMA.flow_diagram(df)
"""
function flow_diagram_df()::DataFrame
cols::Vector{String} = ["box_num", "box_lab", "result"]
cols::Vector{String} = ["box_num", "box_text", "result"]
rows::Vector{Tuple{Int,String,Union{Int,Missing}}} = [
(01, "Previous studies", missing),
(02, "Identification of new studies via databases and registers", missing),
Expand Down Expand Up @@ -126,21 +126,24 @@ end

function group_labels(df::DataFrame)::DataFrame
grouped::GroupedDataFrame = groupby(df, :box_num)
grouped_labels::DataFrame = DataFrame(box_num=Int[], box_lab=String[])
grouped_labels::DataFrame = DataFrame(box_num=Int[], box_text=String[])

for g in grouped
box_num::Int = first(g.box_num)
combined_label::String = join(
[
string(
ifelse(ismissing(row.result), "<b>$(row.box_lab)</b>", row.box_lab),
"<br/>",
ifelse(ismissing(row.result), "", "<i>n</i>&nbsp;=&nbsp;$(row.result)")
) for row in eachrow(g)
], "<br/>"
)

push!(grouped_labels, (box_num, combined_label))
number::Int = first(g.box_num)
labels::Vector{String} = String[]

for row in eachrow(g)
text::String = ismissing(row.result) ? "<b>$(row.box_text)</b>" : row.box_text
result::String = ismissing(row.result) ? "" : "<i>n</i>&nbsp;=&nbsp;$(row.result)"

label::String = string(text, "<br/>", result)

push!(labels, label)
end

group_label::String = join(labels, "<br/>")

push!(grouped_labels, (number, group_label))
end

return grouped_labels
Expand Down Expand Up @@ -268,7 +271,7 @@ const GRAYBOXES::Vector{Number} = [1, 3, 7, 18, 19, 20, 21, 22]

"""
PRISMA.flow_diagram(
data::DataFrame=flow_diagram_df();
data::DataFrame=flow_diagram_df(),
background_color::AbstractString="white",
grayboxes::Bool=true,
grayboxes_color::AbstractString="#f0f0f0",
Expand Down Expand Up @@ -403,7 +406,7 @@ function flow_diagram(
if !(row.box_num in excluded_boxes)
dot_lang *= """
$(row.box_num) [
label=<$(row.box_lab)>,
label=<$(row.box_text)>,
shape=box,
style="filled,$border_style",
fixedsize="true",
Expand Down

0 comments on commit 5aeed02

Please sign in to comment.