Skip to content

Commit

Permalink
bug fix, sorting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Amy Chen committed May 17, 2023
1 parent fe7ee26 commit a56e814
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 29 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORT=8000
REACT_APP_EPIC_SUPPORTED_QUERIES=false
GENERATE_SOURCEMAP=false

#REACT_APP_SYSTEM_TYPE=
#REACT_APP_TABS=overview,report
2 changes: 1 addition & 1 deletion src/config/report_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const reportConfig = [
{
title: "Mental Health, Quality of Life and Sleep",
dataKey: "mentalHealthSection",
questionnaires: ["phq", "gad7"],
questionnaires: ["phq9", "gad7"],
icon: (props) => (
<UserIcon
{...iconProps}
Expand Down
2 changes: 1 addition & 1 deletion src/cql/r4/survey_resources/BODY_DIAGRAM_LogicLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ define ResponsesSummary:
date: LogicHelper.DateTimeText(I.authored),
painLocations: painLocations(I.item),
severePainLocation: severePainLocation(I.item),
authoredDate: I.authored,
authoredDate: I.authored.value,
lastUpdated: I.meta.lastUpdated.value
}
sort by authoredDate desc, lastUpdated desc
Expand Down
10 changes: 7 additions & 3 deletions src/cql/r4/survey_resources/BODY_DIAGRAM_LogicLibrary.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,13 @@
}, {
"name" : "authoredDate",
"value" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
"path" : "value",
"type" : "Property",
"source" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
}
}
}, {
"name" : "lastUpdated",
Expand Down
4 changes: 2 additions & 2 deletions src/cql/r4/survey_resources/GAD7_LogicLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ define ResponsesSummary:
comparisonToAlert: 'higher',
totalAnsweredItems: Length((I.item) O where O.linkId.value != ScoringQuestionId),
totalItems: Length(LogicHelper.GetAnswerLinkIdsByQuestionnaire(Gad7Questionnaire, ScoringQuestionId)),
authoredDate: I.authored,
authoredDate: I.authored.value,
lastUpdated: I.meta.lastUpdated.value
}
sort by date desc, lastUpdated desc
sort by authoredDate desc, lastUpdated desc
12 changes: 8 additions & 4 deletions src/cql/r4/survey_resources/GAD7_LogicLibrary.json
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,13 @@
}, {
"name" : "authoredDate",
"value" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
"path" : "value",
"type" : "Property",
"source" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
}
}
}, {
"name" : "lastUpdated",
Expand All @@ -922,7 +926,7 @@
"sort" : {
"by" : [ {
"direction" : "desc",
"path" : "date",
"path" : "authoredDate",
"type" : "ByColumn"
}, {
"direction" : "desc",
Expand Down
7 changes: 5 additions & 2 deletions src/cql/r4/survey_resources/PEG_LogicLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ define PegQuestionnaire:
define QuestionnaireResponses:
LogicHelper.MatchedReponsesByQuestionnaire([QuestionnaireResponse], PegQuestionnaire, 'PEG')

define ResponsesCompleted:
Length(QuestionnaireResponses)

define ResponsesSummary:
(QuestionnaireResponses) I
let
Expand Down Expand Up @@ -72,7 +75,7 @@ define ResponsesSummary:
Question1Score: ToInteger(Question1Score),
Question2Score: ToInteger(Question2Score),
Question3Score: ToInteger(Question3Score),
responses_completed: Length(I),
responses_completed: ResponsesCompleted,
sum_score: sumScore,
mean_score: score,
score: score,
Expand All @@ -88,7 +91,7 @@ define ResponsesSummary:
comparisonToAlert: 'higher',
totalAnsweredItems: Min({Length((I.item) O where O.linkId.value != ScoringQuestionId), totalItems}),
totalItems: totalItems,
authoredDate: I.authored,
authoredDate: I.authored.value,
lastUpdated: I.meta.lastUpdated.value
}
sort by authoredDate desc, lastUpdated desc
Expand Down
31 changes: 20 additions & 11 deletions src/cql/r4/survey_resources/PEG_LogicLibrary.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@
"type" : "Literal"
} ]
}
}, {
"name" : "ResponsesCompleted",
"context" : "Patient",
"accessLevel" : "Public",
"expression" : {
"type" : "Length",
"operand" : {
"name" : "QuestionnaireResponses",
"type" : "ExpressionRef"
}
}
}, {
"name" : "ResponsesSummary",
"context" : "Patient",
Expand Down Expand Up @@ -522,14 +533,8 @@
}, {
"name" : "responses_completed",
"value" : {
"type" : "Length",
"operand" : {
"type" : "ToList",
"operand" : {
"name" : "I",
"type" : "AliasRef"
}
}
"name" : "ResponsesCompleted",
"type" : "ExpressionRef"
}
}, {
"name" : "sum_score",
Expand Down Expand Up @@ -697,9 +702,13 @@
}, {
"name" : "authoredDate",
"value" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
"path" : "value",
"type" : "Property",
"source" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
}
}
}, {
"name" : "lastUpdated",
Expand Down
2 changes: 1 addition & 1 deletion src/cql/r4/survey_resources/PHQ9_LogicLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ define ResponsesSummary:
comparisonToAlert: 'higher',
totalAnsweredItems: Min({Length((I.item) O where O.linkId.value != ScoringQuestionId), totalItems}),
totalItems: totalItems,
authoredDate: I.authored,
authoredDate: I.authored.value,
lastUpdated: I.meta.lastUpdated.value
}
sort by authoredDate desc, lastUpdated desc
Expand Down
10 changes: 7 additions & 3 deletions src/cql/r4/survey_resources/PHQ9_LogicLibrary.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,9 +1011,13 @@
}, {
"name" : "authoredDate",
"value" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
"path" : "value",
"type" : "Property",
"source" : {
"path" : "authored",
"scope" : "I",
"type" : "Property"
}
}
}, {
"name" : "lastUpdated",
Expand Down
2 changes: 1 addition & 1 deletion src/styles/elements/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $color-box-shadow: #e2dfdf;
$color-divider: #ecf1f2;
$color-warning-light: #f5b237;
$color-warning: #df960e;
$color-warning-dark: #c88b1b;
$color-warning-dark: #af7305;
$color-success: green;
$color-alert: #b70909;
$color-disabled: #909799;
Expand Down

0 comments on commit a56e814

Please sign in to comment.