Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen authored and Amy Chen committed Nov 7, 2023
1 parent 016a18f commit 56e78c2
Show file tree
Hide file tree
Showing 2 changed files with 233 additions and 466 deletions.
27 changes: 4 additions & 23 deletions src/cql/r4/survey_resources/Common_LogicLibrary.cql
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,6 @@ define function MatchedReponsesByQuestionnaire(responses List<FHIR.Questionnaire
sort by authored desc
)

/*
* retrieve list of Tuples containing question and its corresponding answer for a matched questionnaire
* @param currentQuestionnaire, of type FHIR.Questionnaire
* @param responses, of type FHIR.QuestionnaireResponse.Item
* @param ScoringQuestionId, question link id for question containing score
* @return {System.List<Tuple>}
*/
define function getResponsesByQuestionnaire(currentQuestionnaire FHIR.Questionnaire, responses List<FHIR.QuestionnaireResponse.Item>, scoringQuestionId String):
(currentQuestionnaire.item o
where o.linkId.value != 'introduction' and
(PositionOf(o.linkId.value, scoringQuestionId) = -1 or PositionOf(scoringQuestionId, o.linkId.value) = -1)
) I
let
answer: First(GetResponseAnswerByLinkId(I.linkId.value, responses))
return {
linkId: I.linkId.value,
question: I.text.value,
answer: answer,
answerText: if I.answerOption[ToInteger(answer)].value.display is not null then I.answerOption[ToInteger(answer)].value.display.value else null
}

/*
* retrieve concept code of a selected answer option from a Questionnaire
* @param currentQuestionnaire, of type FHIR.Questionnaire
Expand Down Expand Up @@ -225,8 +204,10 @@ define function FormattedQuestionnaireResponses(responseItems List<FHIR.Question
linkId: if I.linkId.value is not null then I.linkId.value else 'n/a',
answer: case
//answer in FHIR coding format
when I.answer[0].value.display is not null then I.answer[0].value.display.value
else I.answer[0].value.value
when I.answer[0].value.display is not null and I.answer[0].value.display.value is not null then
I.answer[0].value.display.value
else
I.answer[0].value.value
end,
question: I.text.value
}
Loading

0 comments on commit 56e78c2

Please sign in to comment.