Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pogues mapping): unique and multiple choice questions #1195

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(pogues mapping): unique choice questions
nsenave committed Jan 3, 2025
commit 02d34d1926b7781b065a42b1467b78c1aec611ba
Original file line number Diff line number Diff line change
@@ -71,12 +71,13 @@ public enum DisplayFormat {RADIO, CHECKBOX, DROPDOWN}
DisplayFormat displayFormat;

/** Reference to the code list that contain the modalities of the question. */
@Pogues("getResponse().getFirst().getDatatype().getCodeListReference()")
@DDI("T(fr.insee.eno.core.model.question.UniqueChoiceQuestion).mapDDICodeListReference(#this)")
String codeListReference;

/**
* List of modalities of the unique choice question.
* In DDI, these are inserted here through a processing.
* In Pogues and DDI, these are inserted here through a processing.
*/
@Lunatic("getOptions()")
List<CodeItem> codeItems = new ArrayList<>();
@@ -93,6 +94,7 @@ public enum DisplayFormat {RADIO, CHECKBOX, DROPDOWN}
/** Detail responses for modalities that have a "please specify" field.
* In DDI, these are mapped at question level.
* In Lunatic, they are inserted in option in through a processing. */
@Pogues("getClarificationQuestion()")
@DDI("T(fr.insee.eno.core.model.question.UniqueChoiceQuestion).mapDetailResponses(#this)")
List<DetailResponse> detailResponses = new ArrayList<>();

@@ -106,7 +108,6 @@ public static DisplayFormat convertPoguesVisualizationHint(QuestionType poguesQu
};
}


/**
* From DDI question item (that correspond to a unique choice question),
* return the eno model display format for the unique choice question.
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ void createPoguesUniqueChoiceQuestion() {
poguesUCQ.setName("UCQ_NAME");
poguesUCQ.getLabel().add("Unique choice question label.");
ResponseType response = new ResponseType();
response.setCodeListReference("code-list-id");
TextDatatypeType datatype = new TextDatatypeType();
datatype.setVisualizationHint(VisualizationHintEnum.RADIO);
response.setDatatype(datatype);
@@ -57,6 +58,7 @@ void unitTests() {
assertEquals("UCQ_NAME", enoUCQ.getName());
assertEquals("Unique choice question label.", enoUCQ.getLabel().getValue());
assertEquals(UniqueChoiceQuestion.DisplayFormat.RADIO, enoUCQ.getDisplayFormat());
assertEquals("code-list-id", enoUCQ.getCodeListReference());
}

}