From d5236b0d539ce40e1afd081c9ea0d5187846d8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20S=C3=A9nave?= <59770457+nsenave@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:45:33 +0200 Subject: [PATCH] fix: controls in loops and filters (#766) * fix(controls): simplify and fix loop and filter cases * refactor: remove control property from sequences Sequence and subsequence doesn't have controls. * test(controls): controls in loops * chore: bump version * ci: tests for pull requests to v3-next --- .github/workflows/gandalf.yml | 1 + build.gradle | 2 +- .../fr/insee/eno/core/model/EnoComponent.java | 1 - .../eno/core/model/question/Question.java | 3 + .../core/model/sequence/AbstractSequence.java | 6 - .../in/steps/ddi/DDIInsertControls.java | 106 +- .../DDIResolveVariableReferencesInLabels.java | 3 +- .../in/steps/ddi/DDIInsertControlsTest.java | 59 + .../resources/functional/ddi/ddi-l7j0wwqx.xml | 2002 +++++++++++++++++ .../functional/lunatic/lunatic-l7j0wwqx.json | 948 ++++++++ .../functional/pogues/pogues-l7j0wwqx.json | 705 ++++++ 11 files changed, 3770 insertions(+), 66 deletions(-) create mode 100644 eno-core/src/test/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControlsTest.java create mode 100644 eno-core/src/test/resources/functional/ddi/ddi-l7j0wwqx.xml create mode 100644 eno-core/src/test/resources/functional/lunatic/lunatic-l7j0wwqx.json create mode 100644 eno-core/src/test/resources/functional/pogues/pogues-l7j0wwqx.json diff --git a/.github/workflows/gandalf.yml b/.github/workflows/gandalf.yml index 242bb9300..43a25c4b0 100644 --- a/.github/workflows/gandalf.yml +++ b/.github/workflows/gandalf.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - 'v3-main' + - 'v3-next' types: [opened, synchronize, reopened, ready_for_review] paths-ignore: ['docs/**', 'logo/**', 'Dockerfile', 'README**.md'] diff --git a/build.gradle b/build.gradle index 817d8a712..9902db112 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { allprojects { group = 'fr.insee.eno' - version = '3.11.2-SNAPSHOT' + version = '3.11.3-SNAPSHOT' sourceCompatibility = '17' } diff --git a/eno-core/src/main/java/fr/insee/eno/core/model/EnoComponent.java b/eno-core/src/main/java/fr/insee/eno/core/model/EnoComponent.java index 0cf3fc5ae..4f9b75fb6 100644 --- a/eno-core/src/main/java/fr/insee/eno/core/model/EnoComponent.java +++ b/eno-core/src/main/java/fr/insee/eno/core/model/EnoComponent.java @@ -13,7 +13,6 @@ public interface EnoComponent { String getId(); List getDeclarations(); List getInstructions(); - List getControls(); ComponentFilter getComponentFilter(); } diff --git a/eno-core/src/main/java/fr/insee/eno/core/model/question/Question.java b/eno-core/src/main/java/fr/insee/eno/core/model/question/Question.java index 5f387cd5c..cb033ec04 100644 --- a/eno-core/src/main/java/fr/insee/eno/core/model/question/Question.java +++ b/eno-core/src/main/java/fr/insee/eno/core/model/question/Question.java @@ -42,6 +42,9 @@ public abstract class Question extends EnoIdentifiableObject implements EnoCompo @Lunatic("getDeclarations()") List instructions = new ArrayList<>(); + /** Controls applied to the question. + * In DDI, the controls are mapped in the questionnaire object, and are put here through a processing. + * In Lunatic, the question components have a list of controls. */ @Lunatic("getControls()") private final List controls = new ArrayList<>(); diff --git a/eno-core/src/main/java/fr/insee/eno/core/model/sequence/AbstractSequence.java b/eno-core/src/main/java/fr/insee/eno/core/model/sequence/AbstractSequence.java index 838acf4b9..2a38c827a 100644 --- a/eno-core/src/main/java/fr/insee/eno/core/model/sequence/AbstractSequence.java +++ b/eno-core/src/main/java/fr/insee/eno/core/model/sequence/AbstractSequence.java @@ -48,12 +48,6 @@ public abstract class AbstractSequence extends EnoIdentifiableObject implements @Lunatic("getDeclarations()") private final List declarations = new ArrayList<>(); - /** Sequence / subsequence controls. - * In DDI, the controls are mapped in the questionnaire object, and are put here through a 'processing' class. - * In Lunatic, the sequence / subsequence object has a list of controls. */ - @Lunatic("getControls()") - private final List controls = new ArrayList<>(); - /** Sequence / subsequence filter. * In DDI, the filters are mapped in the questionnaire object. * If there is a declared filter for this sequence / subsequence, it is put here through a 'processing' class. diff --git a/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControls.java b/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControls.java index 209ccd3a8..aabf5429e 100644 --- a/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControls.java +++ b/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControls.java @@ -2,6 +2,8 @@ import fr.insee.eno.core.model.EnoQuestionnaire; import fr.insee.eno.core.model.navigation.Control; +import fr.insee.eno.core.model.navigation.Filter; +import fr.insee.eno.core.model.navigation.Loop; import fr.insee.eno.core.model.question.Question; import fr.insee.eno.core.model.sequence.ItemReference; import fr.insee.eno.core.model.sequence.Sequence; @@ -16,70 +18,60 @@ public class DDIInsertControls implements ProcessingStep { * This processing is intended to insert them into the objects to which they belong. * (Controls are placed after the object they belong to in the sequence items lists.) * Concerned objects : sequences, subsequences and questions. */ - public void apply(EnoQuestionnaire enoQuestionnaire) { // Note: code is a bit clumsy but works + public void apply(EnoQuestionnaire enoQuestionnaire) { // assert enoQuestionnaire.getIndex() != null; // for (Sequence sequence : enoQuestionnaire.getSequences()) { List sequenceItems = sequence.getSequenceItems(); - if (! sequenceItems.isEmpty()) { - int bound = sequenceItems.size(); - // Sequence controls - int i = 0; - while (i subsequenceItems = subsequence.getSequenceItems(); - if (! subsequenceItems.isEmpty()) { - int bound2 = subsequenceItems.size(); - // Subsequence controls - int j = 0; - while (j itemReferences) { + if (itemReferences.isEmpty()) + return; + int bound = itemReferences.size(); + int i = 0; + while (i < bound) { + ItemReference sequenceItem = itemReferences.get(i); + if (sequenceItem.getType() == ItemReference.ItemType.QUESTION) { + i = insertControlInQuestion(enoQuestionnaire, itemReferences, bound, i, sequenceItem); + } + else if (sequenceItem.getType() == ItemReference.ItemType.SUBSEQUENCE) { + Subsequence subsequence = (Subsequence) enoQuestionnaire.get(sequenceItem.getId()); + List subsequenceItems = subsequence.getSequenceItems(); + insertControlsInReferencedItems(enoQuestionnaire, subsequenceItems); + i ++; + } + else if (sequenceItem.getType() == ItemReference.ItemType.LOOP) { + Loop loop = (Loop) enoQuestionnaire.get(sequenceItem.getId()); + List loopItems = loop.getLoopItems(); + insertControlsInReferencedItems(enoQuestionnaire, loopItems); + i ++; } + else if (sequenceItem.getType() == ItemReference.ItemType.FILTER) { + Filter filter = (Filter) enoQuestionnaire.get(sequenceItem.getId()); + List filterItems = filter.getFilterItems(); + insertControlsInReferencedItems(enoQuestionnaire, filterItems); + i ++; + } + else { // skip other elements + i ++; + } + } + } + + private static int insertControlInQuestion(EnoQuestionnaire enoQuestionnaire, List itemReferences, + int bound, int i, ItemReference questionReferenceItem) { + Question question = (Question) enoQuestionnaire.get(questionReferenceItem.getId()); + i++; + while (i < bound && itemReferences.get(i).getType() == ItemReference.ItemType.CONTROL) { + question.getControls().add( + (Control) enoQuestionnaire.get(itemReferences.get(i).getId())); + i++; } + return i; } } diff --git a/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIResolveVariableReferencesInLabels.java b/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIResolveVariableReferencesInLabels.java index a1618e4a1..b972c494d 100644 --- a/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIResolveVariableReferencesInLabels.java +++ b/eno-core/src/main/java/fr/insee/eno/core/processing/in/steps/ddi/DDIResolveVariableReferencesInLabels.java @@ -46,8 +46,9 @@ public void apply(EnoQuestionnaire enoQuestionnaire) { enoCatalog.getComponents().forEach(enoComponent -> { enoComponent.getDeclarations().stream().map(Declaration::getLabel).forEach(this::resolveLabel); enoComponent.getInstructions().stream().map(Instruction::getLabel).forEach(this::resolveLabel); - enoComponent.getControls().stream().map(Control::getMessage).forEach(this::resolveLabel); }); + enoCatalog.getQuestions().forEach(enoQuestion -> + enoQuestion.getControls().stream().map(Control::getMessage).forEach(this::resolveLabel)); // Code lists enoQuestionnaire.getCodeLists().stream().map(CodeList::getCodeItems).forEach(this::resolveCodeItemsLabel); // Code lists in multiple response questions (might be refactored afterward) diff --git a/eno-core/src/test/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControlsTest.java b/eno-core/src/test/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControlsTest.java new file mode 100644 index 000000000..42cf953ec --- /dev/null +++ b/eno-core/src/test/java/fr/insee/eno/core/processing/in/steps/ddi/DDIInsertControlsTest.java @@ -0,0 +1,59 @@ +package fr.insee.eno.core.processing.in.steps.ddi; + +import fr.insee.eno.core.exceptions.business.DDIParsingException; +import fr.insee.eno.core.mappers.DDIMapper; +import fr.insee.eno.core.model.EnoQuestionnaire; +import fr.insee.eno.core.model.navigation.Control; +import fr.insee.eno.core.model.question.Question; +import fr.insee.eno.core.serialize.DDIDeserializer; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class DDIInsertControlsTest { + + @Test + void questionnaireWithLoops() throws DDIParsingException { + // + EnoQuestionnaire enoQuestionnaire = new EnoQuestionnaire(); + DDIMapper ddiMapper = new DDIMapper(); + ddiMapper.mapDDI( + DDIDeserializer.deserialize(this.getClass().getClassLoader().getResourceAsStream( + "functional/ddi/ddi-l7j0wwqx.xml")), + enoQuestionnaire); + + // + new DDIInsertControls().apply(enoQuestionnaire); + + // + List questions = new ArrayList<>(enoQuestionnaire.getSingleResponseQuestions()); + // + assertTrue(questions.get(0).getControls().isEmpty()); + // + assertEquals(1, questions.get(1).getControls().size()); + assertEquals(Control.Criticality.INFO, questions.get(1).getControls().get(0).getCriticality()); + // + assertEquals(1, questions.get(2).getControls().size()); + assertEquals(Control.Criticality.INFO, questions.get(2).getControls().get(0).getCriticality()); + // + assertEquals(2, questions.get(3).getControls().size()); + assertEquals(Control.Criticality.INFO, questions.get(3).getControls().get(0).getCriticality()); + assertEquals(Control.Criticality.INFO, questions.get(3).getControls().get(1).getCriticality()); + // + assertEquals(1, questions.get(4).getControls().size()); + assertEquals(Control.Criticality.INFO, questions.get(4).getControls().get(0).getCriticality()); + // + assertEquals(1, questions.get(5).getControls().size()); + assertEquals(Control.Criticality.INFO, questions.get(5).getControls().get(0).getCriticality()); + // + assertEquals(1, questions.get(6).getControls().size()); + assertEquals(Control.Criticality.INFO, questions.get(6).getControls().get(0).getCriticality()); + // + assertTrue(questions.get(7).getControls().isEmpty()); + } + +} diff --git a/eno-core/src/test/resources/functional/ddi/ddi-l7j0wwqx.xml b/eno-core/src/test/resources/functional/ddi/ddi-l7j0wwqx.xml new file mode 100644 index 000000000..13d14608b --- /dev/null +++ b/eno-core/src/test/resources/functional/ddi/ddi-l7j0wwqx.xml @@ -0,0 +1,2002 @@ + + + fr.insee + INSEE-l7j0wwqx + 1 + + + QNONREG - Controles intervariables dans boucles liées - ok + + + + fr.insee + RessourcePackage-l7j0wwqx + 1 + + fr.insee + InterviewerInstructionScheme-l7j0wwqx + 1 + + A définir + + + fr.insee + lfm956z0 + 1 + + help + + + SelfAdministeredQuestionnaire.WebBased + + + Interview.Telephone.CATI + + + Interview.FaceToFace.CAPIorCAMI + + + + "LOGENQ : " || ¤kyiqf4wp-QOP-kyiqs1lg¤ + + + + fr.insee + kyiqf4wp-QOP-kyiqs1lg + 1 + OutParameter + + + + + + fr.insee + kyiqiyjr-CI-0-II-0 + 1 + + warning + + + + "Vous avez indiqué avoir deux résidences principales, pouvez-vous corriger l’une de vos réponses ?" + + + + + fr.insee + kyn3wfvd-CI-0-II-0 + 1 + + warning + + + + "supérieur à 5" + + + + + fr.insee + l7j11vrz + 1 + + help + + + SelfAdministeredQuestionnaire.WebBased + + + Interview.Telephone.CATI + + + Interview.FaceToFace.CAPIorCAMI + + + + "Deux controles sur le prénom : un sur le vide et sur Prénom = A" + + + + + fr.insee + kyn41vx2-CI-0-II-0 + 1 + + warning + + + + "prénom = A" + + + + + fr.insee + kyn41vx2-CI-1-II-1 + 1 + + warning + + + + "Prenom est vide" + + + + + fr.insee + kyo4yga9 + 1 + + help + + + SelfAdministeredQuestionnaire.WebBased + + + Interview.Telephone.CATI + + + Interview.FaceToFace.CAPIorCAMI + + + + "Controle si Q1INDIV vide" + + + + + fr.insee + kyn48ve5-CI-0-II-0 + 1 + + warning + + + + "Remplir Q1 INDIV" + + + + + fr.insee + l8udcein + 1 + + help + + + SelfAdministeredQuestionnaire.WebBased + + + Interview.Telephone.CATI + + + Interview.FaceToFace.CAPIorCAMI + + + + " controle si Q1 = 1 et Q2 = 1" + + + + + fr.insee + kyn413gz-CI-0-II-0 + 1 + + warning + + + + "Q1 et Q2 de " || ¤kyn41vx2-QOP-kyn3of5e¤ || " incompatibles" + + + + fr.insee + kyn41vx2-QOP-kyn3of5e + 1 + OutParameter + + + + + + fr.insee + l7izilib + 1 + + help + + + SelfAdministeredQuestionnaire.WebBased + + + Interview.Telephone.CATI + + + Interview.FaceToFace.CAPIorCAMI + + + + "Contrôles : un vérifie que saisie inférieure à 10 " + + + + + fr.insee + kyo4bj5g-CI-0-II-0 + 1 + + warning + + + + "inférieur à 10" + + + + + + fr.insee + ControlConstructScheme-l7j0wwqx + 1 + + fr.insee + Sequence-l7j0wwqx + 1 + + QNONREG - Controles intervariables dans boucles liées - ok + + template + + fr.insee + kwupyhsh + 1 + Sequence + + + + fr.insee + kwupyhsh + 1 + + S1 + + + S1 + + module + + fr.insee + kyiqf4wp-QC + 1 + QuestionConstruct + + + fr.insee + kyiqiyjr-QC + 1 + QuestionConstruct + + + fr.insee + kyiqiyjr-CI-0 + 1 + ComputationItem + + + fr.insee + kyn3wfvd-QC + 1 + QuestionConstruct + + + fr.insee + kyn3wfvd-CI-0 + 1 + ComputationItem + + + fr.insee + kyn3scy8 + 1 + Loop + + + fr.insee + kyn3zwkg + 1 + Loop + + + fr.insee + kyo2vhbm + 1 + Sequence + + + + fr.insee + kyn4090i + 1 + + SOUSSEQ + + + Prénom + + submodule + + fr.insee + kyn41vx2-QC + 1 + QuestionConstruct + + + fr.insee + kyn41vx2-CI-0 + 1 + ComputationItem + + + fr.insee + kyn41vx2-CI-1 + 1 + ComputationItem + + + + fr.insee + kyn43dhb + 1 + + ITERATION + + + Boucles + + submodule + + fr.insee + kyn48ve5-QC + 1 + QuestionConstruct + + + fr.insee + kyn48ve5-CI-0 + 1 + ComputationItem + + + fr.insee + kyn413gz-QC + 1 + QuestionConstruct + + + fr.insee + kyn413gz-CI-0 + 1 + ComputationItem + + + fr.insee + kyo4bj5g-QC + 1 + QuestionConstruct + + + fr.insee + kyo4bj5g-CI-0 + 1 + ComputationItem + + + + fr.insee + kyo2vhbm + 1 + + AUTRE + + + Autre + + submodule + + fr.insee + kyo2xe36-QC + 1 + QuestionConstruct + + + + fr.insee + kyn3scy8 + 1 + + BOUCLEPRENOM + + + + vtl + + fr.insee + kyn3scy8-MIN-IP-1 + 1 + + NBHAB + + + + + fr.insee + kyn3wfvd-QOP-kyn3t3nc + 1 + OutParameter + + + fr.insee + kyn3scy8-MIN-IP-1 + 1 + InParameter + + + kyn3scy8-MIN-IP-1 + + + + + vtl + + fr.insee + kyn3scy8-IP-1 + 1 + + NBHAB + + + + + fr.insee + kyn3wfvd-QOP-kyn3t3nc + 1 + OutParameter + + + fr.insee + kyn3scy8-IP-1 + 1 + InParameter + + + kyn3scy8-IP-1 + + + + + vtl + 1 + + + + fr.insee + kyn3scy8-SEQ + 1 + Sequence + + + + fr.insee + kyn3scy8-SEQ + 1 + + fr.insee + kyn4090i + 1 + Sequence + + + + fr.insee + kyn3zwkg + 1 + + BOUCLEITERATION + + + fr.insee + kyn3zwkg-SEQ + 1 + Sequence + + + + fr.insee + kyn3zwkg-SEQ + 1 + + fr.insee + kyn43dhb + 1 + Sequence + + + + fr.insee + kyiqf4wp-QC + 1 + + LOGENQ + + + fr.insee + kyiqf4wp + 1 + QuestionItem + + + + fr.insee + kyiqiyjr-QC + 1 + + LOGAUT + + + fr.insee + kyiqiyjr + 1 + QuestionItem + + + + fr.insee + kyn3wfvd-QC + 1 + + NBHAB + + + fr.insee + kyn3wfvd + 1 + QuestionItem + + + + fr.insee + kyn41vx2-QC + 1 + + PRENOM + + + fr.insee + kyn41vx2 + 1 + QuestionItem + + + + fr.insee + kyn48ve5-QC + 1 + + Q1INDIV + + + fr.insee + kyn48ve5 + 1 + QuestionItem + + + + fr.insee + kyn413gz-QC + 1 + + Q2INDIV + + + fr.insee + kyn413gz + 1 + QuestionItem + + + + fr.insee + kyo4bj5g-QC + 1 + + MONTANTINDIV + + + fr.insee + kyo4bj5g + 1 + QuestionItem + + + + fr.insee + kyo2xe36-QC + 1 + + FIN + + + fr.insee + kyo2xe36 + 1 + QuestionItem + + + + fr.insee + kyiqiyjr-CI-0 + 1 + + "(nvl($LOGENQ$," ")="1") and (nvl($LOGAUT$," ")="1")" + + + "(nvl($LOGENQ$," ")="1") and (nvl($LOGAUT$," ")="1")" + + + fr.insee + kyiqiyjr-CI-0-II-0 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyiqiyjr-CI-0-IP-1 + 1 + + LOGENQ + + + + fr.insee + kyiqiyjr-CI-0-IP-2 + 1 + + LOGAUT + + + + + fr.insee + kyiqf4wp-QOP-kyiqs1lg + 1 + OutParameter + + + fr.insee + kyiqiyjr-CI-0-IP-1 + 1 + InParameter + + + + + fr.insee + kyiqiyjr-QOP-kyiqmrve + 1 + OutParameter + + + fr.insee + kyiqiyjr-CI-0-IP-2 + 1 + InParameter + + + (nvl(kyiqiyjr-CI-0-IP-1," ")="1") and (nvl(kyiqiyjr-CI-0-IP-2," ")="1") + + + + + fr.insee + kyn3wfvd-CI-0 + 1 + + superieur à 5 + + + superieur à 5 + + + fr.insee + kyn3wfvd-CI-0-II-0 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyn3wfvd-CI-0-IP-1 + 1 + + NBHAB + + + + + fr.insee + kyn3wfvd-QOP-kyn3t3nc + 1 + OutParameter + + + fr.insee + kyn3wfvd-CI-0-IP-1 + 1 + InParameter + + + nvl(kyn3wfvd-CI-0-IP-1,0) > 5 + + + + + fr.insee + kyn41vx2-CI-0 + 1 + + "prénom = A" + + + "prénom = A" + + + fr.insee + kyn41vx2-CI-0-II-0 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyn41vx2-CI-0-IP-1 + 1 + + PRENOM + + + + + fr.insee + kyn41vx2-QOP-kyn3of5e + 1 + OutParameter + + + fr.insee + kyn41vx2-CI-0-IP-1 + 1 + InParameter + + + kyn41vx2-CI-0-IP-1 = "A" + + + + + fr.insee + kyn41vx2-CI-1 + 1 + + "Prenom est vide" + + + "Prenom est vide" + + + fr.insee + kyn41vx2-CI-1-II-1 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyn41vx2-CI-1-IP-1 + 1 + + PRENOM + + + + + fr.insee + kyn41vx2-QOP-kyn3of5e + 1 + OutParameter + + + fr.insee + kyn41vx2-CI-1-IP-1 + 1 + InParameter + + + isnull(kyn41vx2-CI-1-IP-1) + + + + + fr.insee + kyn48ve5-CI-0 + 1 + + "Remplir Q1INDIV" + + + "Remplir Q1INDIV" + + + fr.insee + kyn48ve5-CI-0-II-0 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyn48ve5-CI-0-IP-1 + 1 + + Q1INDIV + + + + + fr.insee + kyn48ve5-QOP-kyn3x544 + 1 + OutParameter + + + fr.insee + kyn48ve5-CI-0-IP-1 + 1 + InParameter + + + isnull(kyn48ve5-CI-0-IP-1) or kyn48ve5-CI-0-IP-1="" + + + + + fr.insee + kyn413gz-CI-0 + 1 + + "Q1 et Q2 incompatibles" + + + "Q1 et Q2 incompatibles" + + + fr.insee + kyn413gz-CI-0-II-0 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyn413gz-CI-0-IP-1 + 1 + + Q1INDIV + + + + fr.insee + kyn413gz-CI-0-IP-2 + 1 + + Q2INDIV + + + + + fr.insee + kyn48ve5-QOP-kyn3x544 + 1 + OutParameter + + + fr.insee + kyn413gz-CI-0-IP-1 + 1 + InParameter + + + + + fr.insee + kyn413gz-QOP-kyn41rw4 + 1 + OutParameter + + + fr.insee + kyn413gz-CI-0-IP-2 + 1 + InParameter + + + nvl(kyn413gz-CI-0-IP-1,"") = "1" and nvl(kyn413gz-CI-0-IP-2,"")="1" + + + + + fr.insee + kyo4bj5g-CI-0 + 1 + + "si inférieur à 10" + + + "si inférieur à 10" + + + fr.insee + kyo4bj5g-CI-0-II-0 + 1 + Instruction + + informational + + + vtl + + fr.insee + kyo4bj5g-CI-0-IP-1 + 1 + + MONTANTINDIV + + + + + fr.insee + kyo4bj5g-QOP-kyo404qr + 1 + OutParameter + + + fr.insee + kyo4bj5g-CI-0-IP-1 + 1 + InParameter + + + kyo4bj5g-CI-0-IP-1 < 10 + + + + + + fr.insee + QuestionScheme-l7j0wwqx + 1 + + A définir + + + fr.insee + kyiqf4wp + 1 + + LOGENQ + + + fr.insee + kyiqf4wp-QOP-kyiqs1lg + 1 + + LOGENQ + + + + + fr.insee + kyiqf4wp-RDOP-kyiqs1lg + 1 + OutParameter + + + fr.insee + kyiqf4wp-QOP-kyiqs1lg + 1 + OutParameter + + + + + "LOGENQ : déclenchera controle si LOGAUT = oui et LOGENT = Oui" + + + + radio-button + + fr.insee + kyiqeu3j + 1 + CodeList + + + fr.insee + kyiqf4wp-RDOP-kyiqs1lg + 1 + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + + fr.insee + lfm956z0 + 1 + Instruction + + + + fr.insee + kyiqiyjr + 1 + + LOGAUT + + + fr.insee + kyiqiyjr-QOP-kyiqmrve + 1 + + LOGAUT + + + + + fr.insee + kyiqiyjr-RDOP-kyiqmrve + 1 + OutParameter + + + fr.insee + kyiqiyjr-QOP-kyiqmrve + 1 + OutParameter + + + + + "LOGAUT : déclenche controle si LOGAUT = oui et LOGENT = Oui" + + + + checkbox + + fr.insee + kyiqeu3j + 1 + CodeList + + + fr.insee + kyiqiyjr-RDOP-kyiqmrve + 1 + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + + + fr.insee + kyn3wfvd + 1 + + NBHAB + + + fr.insee + kyn3wfvd-QOP-kyn3t3nc + 1 + + NBHAB + + + + + fr.insee + kyn3wfvd-RDOP-kyn3t3nc + 1 + OutParameter + + + fr.insee + kyn3wfvd-QOP-kyn3t3nc + 1 + OutParameter + + + + + "NBHAB : controle si > 5" + + + + + 1 + 10 + + Decimal + + fr.insee + kyn3wfvd-RDOP-kyn3t3nc + 1 + + + + + fr.insee + kyn41vx2 + 1 + + PRENOM + + + fr.insee + kyn41vx2-QOP-kyn3of5e + 1 + + PRENOM + + + + + fr.insee + kyn41vx2-RDOP-kyn3of5e + 1 + OutParameter + + + fr.insee + kyn41vx2-QOP-kyn3of5e + 1 + OutParameter + + + + + "Prénom" + + + + + fr.insee + kyn41vx2-RDOP-kyn3of5e + 1 + + + + + fr.insee + l7j11vrz + 1 + Instruction + + + + fr.insee + kyn48ve5 + 1 + + Q1INDIV + + + fr.insee + kyn48ve5-QOP-kyn3x544 + 1 + + Q1INDIV + + + + + fr.insee + kyn48ve5-RDOP-kyn3x544 + 1 + OutParameter + + + fr.insee + kyn48ve5-QOP-kyn3x544 + 1 + OutParameter + + + + + "Q1 de " || ¤kyn41vx2-QOP-kyn3of5e¤ + + + + checkbox + + fr.insee + kyiqeu3j + 1 + CodeList + + + fr.insee + kyn48ve5-RDOP-kyn3x544 + 1 + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + + fr.insee + kyo4yga9 + 1 + Instruction + + + + fr.insee + kyn413gz + 1 + + Q2INDIV + + + fr.insee + kyn413gz-QOP-kyn41rw4 + 1 + + Q2INDIV + + + + + fr.insee + kyn413gz-RDOP-kyn41rw4 + 1 + OutParameter + + + fr.insee + kyn413gz-QOP-kyn41rw4 + 1 + OutParameter + + + + + "Q2 de " || ¤kyn41vx2-QOP-kyn3of5e¤ + + + + radio-button + + fr.insee + kyiqeu3j + 1 + CodeList + + + fr.insee + kyn413gz-RDOP-kyn41rw4 + 1 + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + + fr.insee + l8udcein + 1 + Instruction + + + + fr.insee + kyo4bj5g + 1 + + MONTANTINDIV + + + fr.insee + kyo4bj5g-QOP-kyo404qr + 1 + + MONTANTINDIV + + + + + fr.insee + kyo4bj5g-RDOP-kyo404qr + 1 + OutParameter + + + fr.insee + kyo4bj5g-QOP-kyo404qr + 1 + OutParameter + + + + + "Montant entre 0 et 100 pour l'individu " || ¤kyn41vx2-QOP-kyn3of5e¤ + + + + + 0 + 100 + + Decimal + + fr.insee + kyo4bj5g-RDOP-kyo404qr + 1 + + + + fr.insee + l7izilib + 1 + Instruction + + + + fr.insee + kyo2xe36 + 1 + + FIN + + + fr.insee + kyo2xe36-QOP-kyo2pqqn + 1 + + FIN + + + + + fr.insee + kyo2xe36-RDOP-kyo2pqqn + 1 + OutParameter + + + fr.insee + kyo2xe36-QOP-kyo2pqqn + 1 + OutParameter + + + + + FIN + + + + + fr.insee + kyo2xe36-RDOP-kyo2pqqn + 1 + + + + + + + fr.insee + CategoryScheme-kyiqeu3j + 1 + + l_ouinon + + + fr.insee + CA-kyiqeu3j-1 + 1 + + "Oui" + + + + fr.insee + CA-kyiqeu3j-2 + 1 + + "Non" + + + + + fr.insee + CategoryScheme-l7j0wwqx + 1 + + A définir + + + fr.insee + INSEE-COMMUN-CA-Booleen-1 + 1 + + + + + + + fr.insee + TESTANNE-CLS + 1 + + TESTANNE + + + fr.insee + kyiqeu3j + 1 + + l_ouinon + + Regular + + Ordinal + + + fr.insee + kyiqeu3j-1 + 1 + + fr.insee + CA-kyiqeu3j-1 + 1 + Category + + 1 + + + fr.insee + kyiqeu3j-2 + 1 + + fr.insee + CA-kyiqeu3j-2 + 1 + Category + + 2 + + + + fr.insee + INSEE-COMMUN-CL-Booleen + 1 + + Booleen + + Regular + + Ordinal + + + fr.insee + INSEE-COMMUN-CL-Booleen-1 + 1 + + fr.insee + INSEE-COMMUN-CA-Booleen-1 + 1 + Category + + 1 + + + + + fr.insee + VariableScheme-l7j0wwqx + 1 + + Variable Scheme for the survey + + + fr.insee + lfm94wtj + 1 + + LOGENQ + + + LOGENQ label + + + fr.insee + kyiqf4wp-QOP-kyiqs1lg + 1 + OutParameter + + + fr.insee + kyiqf4wp + 1 + QuestionItem + + + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + fr.insee + kyiqr3v7 + 1 + + LOGAUT + + + LOGAUT label + + + fr.insee + kyiqiyjr-QOP-kyiqmrve + 1 + OutParameter + + + fr.insee + kyiqiyjr + 1 + QuestionItem + + + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + fr.insee + kyo4hkga + 1 + + NBHAB + + + NBHAB label + + + fr.insee + kyn3wfvd-QOP-kyn3t3nc + 1 + OutParameter + + + fr.insee + kyn3wfvd + 1 + QuestionItem + + + + + 1 + 10 + + Decimal + + + + + fr.insee + l7j00ovr + 1 + + PRENOM + + + PRENOM label + + + fr.insee + kyn41vx2-QOP-kyn3of5e + 1 + OutParameter + + + fr.insee + kyn41vx2 + 1 + QuestionItem + + + + + + + fr.insee + lfm9crtk + 1 + + Q1INDIV + + + Q1INDIV label + + + fr.insee + kyn48ve5-QOP-kyn3x544 + 1 + OutParameter + + + fr.insee + kyn48ve5 + 1 + QuestionItem + + + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + fr.insee + l7j0hhhe + 1 + + Q2INDIV + + + Q2INDIV label + + + fr.insee + kyn413gz-QOP-kyn41rw4 + 1 + OutParameter + + + fr.insee + kyn413gz + 1 + QuestionItem + + + + + fr.insee + kyiqeu3j + 1 + CodeList + + + + + + fr.insee + kyo48ov1 + 1 + + MONTANTINDIV + + + MONTANTINDIV label + + + fr.insee + kyo4bj5g-QOP-kyo404qr + 1 + OutParameter + + + fr.insee + kyo4bj5g + 1 + QuestionItem + + + + + 0 + 100 + + Decimal + + + + + fr.insee + kyo35o1j + 1 + + FIN + + + FIN label + + + fr.insee + kyo2xe36-QOP-kyo2pqqn + 1 + OutParameter + + + fr.insee + kyo2xe36 + 1 + QuestionItem + + + + + + + fr.insee + kyn3scy8-vg + 1 + + + fr.insee + kyn3scy8 + 1 + Loop + + + fr.insee + kyn3zwkg + 1 + Loop + + + Loop + + BOUCLEPRENOM + + + fr.insee + l7j00ovr + 1 + Variable + + + fr.insee + lfm9crtk + 1 + Variable + + + fr.insee + l7j0hhhe + 1 + Variable + + + fr.insee + kyo48ov1 + 1 + Variable + + + + fr.insee + INSEE-Instrument-l7j0wwqx-vg + 1 + + + fr.insee + Instrument-l7j0wwqx + 1 + Instrument + + + Questionnaire + + TESTANNE + + + fr.insee + lfm94wtj + 1 + Variable + + + fr.insee + kyiqr3v7 + 1 + Variable + + + fr.insee + kyo4hkga + 1 + Variable + + + fr.insee + kyo35o1j + 1 + Variable + + + fr.insee + kyn3scy8-vg + 1 + VariableGroup + + + + + fr.insee + INSEE-SIMPSONS-PIS-1 + 1 + + SIMPSONS + + + Processing instructions of the Simpsons questionnaire + + + + fr.insee + INSEE-SIMPSONS-MRS + 1 + + Liste de formats numériques et dates de + l'enquête + Numeric and DateTime list for the survey + + + + + fr.insee + StudyUnit-l7j0wwqx + 1 + + + fr.insee + DataCollection-l7j0wwqx + 1 + + fr.insee + QuestionScheme-l7j0wwqx + 1 + QuestionScheme + + + fr.insee + ControlConstructScheme-l7j0wwqx + 1 + ControlConstructScheme + + + fr.insee + InterviewerInstructionScheme-l7j0wwqx + 1 + InterviewerInstructionScheme + + + fr.insee + InstrumentScheme-l7j0wwqx + 1 + + fr.insee + Instrument-l7j0wwqx + 1 + + TESTANNE + + + QNONREG - Controles intervariables dans boucles liées - ok questionnaire + + A définir + + fr.insee + Sequence-l7j0wwqx + 1 + Sequence + + + + + + diff --git a/eno-core/src/test/resources/functional/lunatic/lunatic-l7j0wwqx.json b/eno-core/src/test/resources/functional/lunatic/lunatic-l7j0wwqx.json new file mode 100644 index 000000000..fde50d619 --- /dev/null +++ b/eno-core/src/test/resources/functional/lunatic/lunatic-l7j0wwqx.json @@ -0,0 +1,948 @@ +{ + "id": "l7j0wwqx", + "modele": "TESTANNE", + "enoCoreVersion": "2.4.10", + "lunaticModelVersion": "2.3.4", + "generatingDate": "23-10-2023 15:17:53", + "missing": false, + "pagination": "question", + "maxPage": "7", + "label": { + "value": "QNONREG - Controles intervariables dans boucles liées - ok", + "type": "VTL|MD" + }, + "components": [ + { + "id": "kwupyhsh", + "componentType": "Sequence", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + } + } + }, + { + "id": "kyiqf4wp", + "componentType": "Radio", + "mandatory": false, + "page": "2", + "label": { + "value": "\"➡ \" || \"LOGENQ : déclenchera controle si LOGAUT = oui et LOGENT = Oui\"", + "type": "VTL|MD" + }, + "declarations": [ + { + "id": "kyiqf4wp-lfm956z0", + "declarationType": "HELP", + "position": "AFTER_QUESTION_TEXT", + "label": { + "value": "\"LOGENQ : \" || LOGENQ", + "type": "VTL|MD" + } + } + ], + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "LOGENQ" + ], + "options": [ + { + "value": "1", + "label": { + "value": "\"Oui\"", + "type": "VTL|MD" + } + }, + { + "value": "2", + "label": { + "value": "\"Non\"", + "type": "VTL|MD" + } + } + ], + "response": { + "name": "LOGENQ" + } + }, + { + "id": "kyiqiyjr", + "componentType": "CheckboxOne", + "mandatory": false, + "page": "3", + "label": { + "value": "\"➡ \" || \"LOGAUT : déclenche controle si LOGAUT = oui et LOGENT = Oui\"", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "controls": [ + { + "id": "kyiqiyjr-CI-0", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not((nvl(LOGENQ,\" \")=\"1\") and (nvl(LOGAUT,\" \")=\"1\"))", + "type": "VTL" + }, + "errorMessage": { + "value": "\"Vous avez indiqué avoir deux résidences principales, pouvez-vous corriger l’une de vos réponses ?\"", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "LOGENQ", + "LOGAUT" + ] + } + ], + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "LOGAUT" + ], + "options": [ + { + "value": "1", + "label": { + "value": "\"Oui\"", + "type": "VTL|MD" + } + }, + { + "value": "2", + "label": { + "value": "\"Non\"", + "type": "VTL|MD" + } + } + ], + "response": { + "name": "LOGAUT" + } + }, + { + "id": "kyn3wfvd", + "componentType": "InputNumber", + "mandatory": false, + "page": "4", + "min": 1, + "max": 10, + "decimals": 0, + "label": { + "value": "\"➡ \" || \"NBHAB : controle si > 5\"", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "controls": [ + { + "id": "kyn3wfvd-format-borne-inf-sup", + "typeOfControl": "FORMAT", + "criticality": "ERROR", + "control": { + "value": "not(not(isnull(NBHAB)) and (1>NBHAB or 10NBHAB)", + "type": "VTL" + }, + "errorMessage": { + "value": "\"Le nombre doit comporter au maximum 0 chiffre(s) après la virgule.\"", + "type": "VTL|MD" + } + }, + { + "id": "kyn3wfvd-CI-0", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not(nvl(NBHAB,0) > 5)", + "type": "VTL" + }, + "errorMessage": { + "value": "\"supérieur à 5\"", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "NBHAB" + ] + } + ], + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "NBHAB" + ], + "response": { + "name": "NBHAB" + } + }, + { + "id": "kyn3scy8", + "componentType": "Loop", + "page": "5", + "depth": 1, + "paginatedLoop": false, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "NBHAB", + "PRENOM" + ], + "loopDependencies": [ + "NBHAB" + ], + "lines": { + "min": { + "value": "NBHAB", + "type": "VTL" + }, + "max": { + "value": "NBHAB", + "type": "VTL" + } + }, + "components": [ + { + "id": "kyn4090i", + "componentType": "Subsequence", + "page": "5", + "goToPage": "5", + "label": { + "value": "Prénom", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyn4090i", + "page": "5", + "label": { + "value": "Prénom", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "NBHAB" + ] + }, + { + "id": "kyn41vx2", + "componentType": "Input", + "mandatory": false, + "page": "5", + "maxLength": 249, + "label": { + "value": "\"➡ \" || \"Prénom\"", + "type": "VTL|MD" + }, + "declarations": [ + { + "id": "kyn41vx2-l7j11vrz", + "declarationType": "HELP", + "position": "AFTER_QUESTION_TEXT", + "label": { + "value": "\"Deux controles sur le prénom : un sur le vide et sur Prénom = A\"", + "type": "VTL|MD" + } + } + ], + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "controls": [ + { + "id": "kyn41vx2-CI-0", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not(PRENOM = \"A\")", + "type": "VTL" + }, + "errorMessage": { + "value": "\"prénom = A\"", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "PRENOM" + ] + }, + { + "id": "kyn41vx2-CI-1", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not(isnull(PRENOM))", + "type": "VTL" + }, + "errorMessage": { + "value": "\"Prenom est vide\"", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "PRENOM" + ] + } + ], + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyn4090i", + "page": "5", + "label": { + "value": "Prénom", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "PRENOM", + "NBHAB" + ], + "response": { + "name": "PRENOM" + } + } + ] + }, + { + "id": "kyn3zwkg", + "componentType": "Loop", + "page": "6", + "maxPage": "3", + "depth": 1, + "paginatedLoop": true, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "PRENOM", + "Q1INDIV", + "Q2INDIV", + "MONTANTINDIV" + ], + "loopDependencies": [ + "PRENOM" + ], + "components": [ + { + "id": "kyn43dhb", + "componentType": "Subsequence", + "goToPage": "6.1", + "label": { + "value": "Boucles", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyn43dhb", + "page": "6.1", + "label": { + "value": "Boucles", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "PRENOM" + ] + }, + { + "id": "kyn48ve5", + "componentType": "CheckboxOne", + "mandatory": false, + "page": "6.1", + "label": { + "value": "\"➡ \" || \"Q1 de \" || PRENOM", + "type": "VTL|MD" + }, + "declarations": [ + { + "id": "kyn48ve5-kyo4yga9", + "declarationType": "HELP", + "position": "AFTER_QUESTION_TEXT", + "label": { + "value": "\"Controle si Q1INDIV vide\"", + "type": "VTL|MD" + } + } + ], + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "controls": [ + { + "id": "kyn48ve5-CI-0", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not(isnull(Q1INDIV) or Q1INDIV=\"\")", + "type": "VTL" + }, + "errorMessage": { + "value": "\"Remplir Q1 INDIV\"", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "Q1INDIV" + ] + } + ], + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyn43dhb", + "page": "6.1", + "label": { + "value": "Boucles", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "PRENOM", + "Q1INDIV" + ], + "options": [ + { + "value": "1", + "label": { + "value": "\"Oui\"", + "type": "VTL|MD" + } + }, + { + "value": "2", + "label": { + "value": "\"Non\"", + "type": "VTL|MD" + } + } + ], + "response": { + "name": "Q1INDIV" + } + }, + { + "id": "kyn413gz", + "componentType": "Radio", + "mandatory": false, + "page": "6.2", + "label": { + "value": "\"➡ \" || \"Q2 de \" || PRENOM", + "type": "VTL|MD" + }, + "declarations": [ + { + "id": "kyn413gz-l8udcein", + "declarationType": "HELP", + "position": "AFTER_QUESTION_TEXT", + "label": { + "value": "\" controle si Q1 = 1 et Q2 = 1\"", + "type": "VTL|MD" + } + } + ], + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "controls": [ + { + "id": "kyn413gz-CI-0", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not(nvl(Q1INDIV,\"\") = \"1\" and nvl(Q2INDIV,\"\")=\"1\")", + "type": "VTL" + }, + "errorMessage": { + "value": "\"Q1 et Q2 de \" || PRENOM || \" incompatibles\" ", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "Q1INDIV", + "Q2INDIV", + "PRENOM" + ] + } + ], + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyn43dhb", + "page": "6.1", + "label": { + "value": "Boucles", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "PRENOM", + "Q2INDIV" + ], + "options": [ + { + "value": "1", + "label": { + "value": "\"Oui\"", + "type": "VTL|MD" + } + }, + { + "value": "2", + "label": { + "value": "\"Non\"", + "type": "VTL|MD" + } + } + ], + "response": { + "name": "Q2INDIV" + } + }, + { + "id": "kyo4bj5g", + "componentType": "InputNumber", + "mandatory": false, + "page": "6.3", + "min": 0, + "max": 100, + "decimals": 0, + "label": { + "value": "\"➡ \" || \"Montant entre 0 et 100 pour l’individu \" || PRENOM", + "type": "VTL|MD" + }, + "declarations": [ + { + "id": "kyo4bj5g-l7izilib", + "declarationType": "HELP", + "position": "AFTER_QUESTION_TEXT", + "label": { + "value": "\"Contrôles : un vérifie que saisie inférieure à 10 \"", + "type": "VTL|MD" + } + } + ], + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "controls": [ + { + "id": "kyo4bj5g-format-borne-inf-sup", + "typeOfControl": "FORMAT", + "criticality": "ERROR", + "control": { + "value": "not(not(isnull(MONTANTINDIV)) and (0>MONTANTINDIV or 100MONTANTINDIV)", + "type": "VTL" + }, + "errorMessage": { + "value": "\"Le nombre doit comporter au maximum 0 chiffre(s) après la virgule.\"", + "type": "VTL|MD" + } + }, + { + "id": "kyo4bj5g-CI-0", + "typeOfControl": "CONSISTENCY", + "criticality": "WARN", + "control": { + "value": "not(MONTANTINDIV < 10)", + "type": "VTL" + }, + "errorMessage": { + "value": "\"inférieur à 10\"", + "type": "VTL|MD" + }, + "bindingDependencies": [ + "MONTANTINDIV" + ] + } + ], + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyn43dhb", + "page": "6.1", + "label": { + "value": "Boucles", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "PRENOM", + "MONTANTINDIV" + ], + "response": { + "name": "MONTANTINDIV" + } + } + ], + "iterations": { + "value": "count(PRENOM)", + "type": "VTL" + } + }, + { + "id": "kyo2vhbm", + "componentType": "Subsequence", + "goToPage": "7", + "label": { + "value": "Autre", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyo2vhbm", + "page": "7", + "label": { + "value": "Autre", + "type": "VTL|MD" + } + } + } + }, + { + "id": "kyo2xe36", + "componentType": "Input", + "mandatory": false, + "page": "7", + "maxLength": 249, + "label": { + "value": "\"➡ \" || \"FIN \"", + "type": "VTL|MD" + }, + "conditionFilter": { + "value": "true", + "type": "VTL" + }, + "hierarchy": { + "sequence": { + "id": "kwupyhsh", + "page": "1", + "label": { + "value": "\"I - \" || \"S1\"", + "type": "VTL|MD" + } + }, + "subSequence": { + "id": "kyo2vhbm", + "page": "7", + "label": { + "value": "Autre", + "type": "VTL|MD" + } + } + }, + "bindingDependencies": [ + "FIN" + ], + "response": { + "name": "FIN" + } + } + ], + "variables": [ + { + "variableType": "COLLECTED", + "name": "LOGENQ", + "values": { + "PREVIOUS": null, + "COLLECTED": null, + "FORCED": null, + "EDITED": null, + "INPUTED": null + } + }, + { + "variableType": "COLLECTED", + "name": "LOGAUT", + "values": { + "PREVIOUS": null, + "COLLECTED": null, + "FORCED": null, + "EDITED": null, + "INPUTED": null + } + }, + { + "variableType": "COLLECTED", + "name": "NBHAB", + "values": { + "PREVIOUS": null, + "COLLECTED": null, + "FORCED": null, + "EDITED": null, + "INPUTED": null + } + }, + { + "variableType": "COLLECTED", + "name": "PRENOM", + "values": { + "PREVIOUS": [ + null + ], + "COLLECTED": [ + null + ], + "FORCED": [ + null + ], + "EDITED": [ + null + ], + "INPUTED": [ + null + ] + } + }, + { + "variableType": "COLLECTED", + "name": "Q1INDIV", + "values": { + "PREVIOUS": [ + null + ], + "COLLECTED": [ + null + ], + "FORCED": [ + null + ], + "EDITED": [ + null + ], + "INPUTED": [ + null + ] + } + }, + { + "variableType": "COLLECTED", + "name": "Q2INDIV", + "values": { + "PREVIOUS": [ + null + ], + "COLLECTED": [ + null + ], + "FORCED": [ + null + ], + "EDITED": [ + null + ], + "INPUTED": [ + null + ] + } + }, + { + "variableType": "COLLECTED", + "name": "MONTANTINDIV", + "values": { + "PREVIOUS": [ + null + ], + "COLLECTED": [ + null + ], + "FORCED": [ + null + ], + "EDITED": [ + null + ], + "INPUTED": [ + null + ] + } + }, + { + "variableType": "COLLECTED", + "name": "FIN", + "values": { + "PREVIOUS": null, + "COLLECTED": null, + "FORCED": null, + "EDITED": null, + "INPUTED": null + } + } + ], + "cleaning": {}, + "resizing": { + "NBHAB": { + "size": "NBHAB", + "variables": [ + "PRENOM", + "Q1INDIV", + "Q2INDIV", + "MONTANTINDIV" + ] + } + } +} \ No newline at end of file diff --git a/eno-core/src/test/resources/functional/pogues/pogues-l7j0wwqx.json b/eno-core/src/test/resources/functional/pogues/pogues-l7j0wwqx.json new file mode 100644 index 000000000..cd3724cc0 --- /dev/null +++ b/eno-core/src/test/resources/functional/pogues/pogues-l7j0wwqx.json @@ -0,0 +1,705 @@ +{ + "owner": "QNONREG", + "FlowControl": [], + "ComponentGroup": [ + { + "MemberReference": [ + "kwupyhsh", + "kyiqf4wp", + "kyiqiyjr", + "kyn3wfvd", + "kyn4090i", + "kyn41vx2", + "kyn43dhb", + "kyn48ve5", + "kyn413gz", + "kyo4bj5g", + "kyo2vhbm", + "kyo2xe36", + "idendquest" + ], + "Label": [ + "Components for page 1" + ], + "id": "kwupta0a", + "Name": "PAGE_1" + } + ], + "agency": "fr.insee", + "genericName": "QUESTIONNAIRE", + "Label": [ + "QNONREG - Controles intervariables dans boucles liées - ok" + ], + "childQuestionnaireRef": [], + "Name": "TESTANNE", + "Variables": { + "Variable": [ + { + "Label": "LOGENQ label", + "id": "lfm94wtj", + "type": "CollectedVariableType", + "CodeListReference": "kyiqeu3j", + "Name": "LOGENQ", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 1 + } + }, + { + "Label": "LOGAUT label", + "id": "kyiqr3v7", + "type": "CollectedVariableType", + "CodeListReference": "kyiqeu3j", + "Name": "LOGAUT", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 1 + } + }, + { + "Label": "NBHAB label", + "id": "kyo4hkga", + "type": "CollectedVariableType", + "Name": "NBHAB", + "Datatype": { + "Maximum": "10", + "Minimum": "1", + "typeName": "NUMERIC", + "Unit": "", + "type": "NumericDatatypeType", + "Decimals": "" + } + }, + { + "Scope": "kyn3scy8", + "Label": "PRENOM label", + "id": "l7j00ovr", + "type": "CollectedVariableType", + "Name": "PRENOM", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 249 + } + }, + { + "Scope": "kyn3scy8", + "Label": "Q1INDIV label", + "id": "lfm9crtk", + "type": "CollectedVariableType", + "CodeListReference": "kyiqeu3j", + "Name": "Q1INDIV", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 1 + } + }, + { + "Scope": "kyn3scy8", + "Label": "Q2INDIV label", + "id": "l7j0hhhe", + "type": "CollectedVariableType", + "CodeListReference": "kyiqeu3j", + "Name": "Q2INDIV", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 1 + } + }, + { + "Scope": "kyn3scy8", + "Label": "MONTANTINDIV label", + "id": "kyo48ov1", + "type": "CollectedVariableType", + "Name": "MONTANTINDIV", + "Datatype": { + "Maximum": "100", + "Minimum": "0", + "typeName": "NUMERIC", + "Unit": "", + "type": "NumericDatatypeType", + "Decimals": "" + } + }, + { + "Label": "FIN label", + "id": "kyo35o1j", + "type": "CollectedVariableType", + "Name": "FIN", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 249 + } + } + ] + }, + "lastUpdatedDate": "Fri Mar 24 2023 09:00:58 GMT+0100 (heure normale d’Europe centrale)", + "DataCollection": [ + { + "id": "esa-dc-2018", + "uri": "http://ddi:fr.insee:DataCollection.esa-dc-2018" + }, + { + "id": "d5225468-f2c0-4a1b-a662-7b892d9bd734", + "uri": "http://ddi:fr.insee:DataCollection.d5225468-f2c0-4a1b-a662-7b892d9bd734" + } + ], + "final": false, + "flowLogic": "FILTER", + "id": "l7j0wwqx", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "CodeLists": { + "CodeList": [ + { + "Label": "l_ouinon", + "id": "kyiqeu3j", + "Code": [ + { + "Parent": "", + "Label": "\"Oui\"", + "Value": "1" + }, + { + "Parent": "", + "Label": "\"Non\"", + "Value": "2" + } + ], + "Name": "" + } + ] + }, + "Iterations": { + "Iteration": [ + { + "Maximum": "$NBHAB$", + "Minimum": "$NBHAB$", + "MemberReference": [ + "kyn4090i" + ], + "id": "kyn3scy8", + "Step": "1", + "type": "DynamicIterationType", + "Name": "BOUCLEPRENOM" + }, + { + "MemberReference": [ + "kyn43dhb" + ], + "id": "kyn3zwkg", + "type": "DynamicIterationType", + "Name": "BOUCLEITERATION", + "IterableReference": "kyn3scy8" + } + ] + }, + "formulasLanguage": "VTL", + "Child": [ + { + "Control": [], + "depth": 1, + "FlowControl": [], + "genericName": "MODULE", + "Label": [ + "S1" + ], + "id": "kwupyhsh", + "TargetMode": [ + "CATI", + "CAWI" + ], + "Declaration": [], + "type": "SequenceType", + "Child": [ + { + "Response": [ + { + "CollectedVariableReference": "lfm94wtj", + "id": "kyiqs1lg", + "mandatory": false, + "CodeListReference": "kyiqeu3j", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "visualizationHint": "RADIO", + "type": "TextDatatypeType", + "MaxLength": 1 + } + } + ], + "Control": [], + "depth": 2, + "FlowControl": [], + "Label": [ + "\"LOGENQ : déclenchera controle si LOGAUT = oui et LOGENT = Oui\"" + ], + "ClarificationQuestion": [], + "id": "kyiqf4wp", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [ + { + "declarationType": "HELP", + "Text": "\"LOGENQ : \" || $LOGENQ$", + "id": "lfm956z0", + "position": "AFTER_QUESTION_TEXT", + "DeclarationMode": [ + "CATI", + "CAWI", + "CAPI" + ] + } + ], + "type": "QuestionType", + "questionType": "SINGLE_CHOICE", + "Name": "LOGENQ" + }, + { + "Response": [ + { + "CollectedVariableReference": "kyiqr3v7", + "id": "kyiqmrve", + "mandatory": false, + "CodeListReference": "kyiqeu3j", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "visualizationHint": "CHECKBOX", + "type": "TextDatatypeType", + "MaxLength": 1 + } + } + ], + "Control": [ + { + "post_collect": false, + "Description": "\"(nvl($LOGENQ$,\" \")=\"1\") and (nvl($LOGAUT$,\" \")=\"1\")\"", + "Expression": "(nvl($LOGENQ$,\" \")=\"1\") and (nvl($LOGAUT$,\" \")=\"1\")", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"Vous avez indiqué avoir deux résidences principales, pouvez-vous corriger l’une de vos réponses ?\"", + "id": "kyir0oy4" + } + ], + "depth": 2, + "FlowControl": [], + "Label": [ + "\"LOGAUT : déclenche controle si LOGAUT = oui et LOGENT = Oui\"" + ], + "ClarificationQuestion": [], + "id": "kyiqiyjr", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "QuestionType", + "questionType": "SINGLE_CHOICE", + "Name": "LOGAUT" + }, + { + "Response": [ + { + "CollectedVariableReference": "kyo4hkga", + "id": "kyn3t3nc", + "mandatory": false, + "Datatype": { + "Maximum": "10", + "Minimum": "1", + "typeName": "NUMERIC", + "Unit": "", + "type": "NumericDatatypeType", + "Decimals": "" + } + } + ], + "Control": [ + { + "post_collect": false, + "Description": "superieur à 5", + "Expression": "nvl($NBHAB$,0) > 5", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"supérieur à 5\"", + "id": "kyo4g54x" + } + ], + "depth": 2, + "FlowControl": [], + "Label": [ + "\"NBHAB : controle si > 5\"" + ], + "id": "kyn3wfvd", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "QuestionType", + "questionType": "SIMPLE", + "Name": "NBHAB" + }, + { + "Control": [], + "depth": 2, + "FlowControl": [], + "genericName": "SUBMODULE", + "Label": [ + "Prénom" + ], + "id": "kyn4090i", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "SequenceType", + "Child": [ + { + "Response": [ + { + "CollectedVariableReference": "l7j00ovr", + "id": "kyn3of5e", + "mandatory": false, + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 249 + } + } + ], + "Control": [ + { + "post_collect": false, + "Description": "\"prénom = A\"", + "Expression": "$PRENOM$ = \"A\"", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"prénom = A\"", + "id": "l5quecj4" + }, + { + "post_collect": false, + "Description": "\"Prenom est vide\"", + "Expression": "isnull($PRENOM$)", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"Prenom est vide\"", + "id": "l7iz5gd1" + } + ], + "depth": 3, + "FlowControl": [], + "Label": [ + "\"Prénom\"" + ], + "id": "kyn41vx2", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [ + { + "declarationType": "HELP", + "Text": "\"Deux controles sur le prénom : un sur le vide et sur Prénom = A\"", + "id": "l7j11vrz", + "position": "AFTER_QUESTION_TEXT", + "DeclarationMode": [ + "CATI", + "CAWI", + "CAPI" + ] + } + ], + "type": "QuestionType", + "questionType": "SIMPLE", + "Name": "PRENOM" + } + ], + "Name": "SOUSSEQ" + }, + { + "Control": [], + "depth": 2, + "FlowControl": [], + "genericName": "SUBMODULE", + "Label": [ + "Boucles" + ], + "id": "kyn43dhb", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "SequenceType", + "Child": [ + { + "Response": [ + { + "CollectedVariableReference": "lfm9crtk", + "id": "kyn3x544", + "mandatory": false, + "CodeListReference": "kyiqeu3j", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "visualizationHint": "CHECKBOX", + "type": "TextDatatypeType", + "MaxLength": 1 + } + } + ], + "Control": [ + { + "post_collect": false, + "Description": "\"Remplir Q1INDIV\"", + "Expression": "isnull($Q1INDIV$) or $Q1INDIV$=\"\"", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"Remplir Q1 INDIV\"", + "id": "kyo4w2xi" + } + ], + "depth": 3, + "FlowControl": [], + "Label": [ + "\"Q1 de \" || $PRENOM$" + ], + "ClarificationQuestion": [], + "id": "kyn48ve5", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [ + { + "declarationType": "HELP", + "Text": "\"Controle si Q1INDIV vide\"", + "id": "kyo4yga9", + "position": "AFTER_QUESTION_TEXT", + "DeclarationMode": [ + "CATI", + "CAWI", + "CAPI" + ] + } + ], + "type": "QuestionType", + "questionType": "SINGLE_CHOICE", + "Name": "Q1INDIV" + }, + { + "Response": [ + { + "CollectedVariableReference": "l7j0hhhe", + "id": "kyn41rw4", + "mandatory": false, + "CodeListReference": "kyiqeu3j", + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "visualizationHint": "RADIO", + "type": "TextDatatypeType", + "MaxLength": 1 + } + } + ], + "Control": [ + { + "post_collect": false, + "Description": "\"Q1 et Q2 incompatibles\"", + "Expression": "nvl($Q1INDIV$,\"\") = \"1\" and nvl($Q2INDIV$,\"\")=\"1\"", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"Q1 et Q2 de \" || $PRENOM$ || \" incompatibles\"", + "id": "l8udecg5" + } + ], + "depth": 3, + "FlowControl": [], + "Label": [ + "\"Q2 de \" || $PRENOM$" + ], + "ClarificationQuestion": [], + "id": "kyn413gz", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [ + { + "declarationType": "HELP", + "Text": "\" controle si Q1 = 1 et Q2 = 1\"", + "id": "l8udcein", + "position": "AFTER_QUESTION_TEXT", + "DeclarationMode": [ + "CATI", + "CAWI", + "CAPI" + ] + } + ], + "type": "QuestionType", + "questionType": "SINGLE_CHOICE", + "Name": "Q2INDIV" + }, + { + "Response": [ + { + "CollectedVariableReference": "kyo48ov1", + "id": "kyo404qr", + "mandatory": false, + "Datatype": { + "Maximum": "100", + "Minimum": "0", + "typeName": "NUMERIC", + "Unit": "", + "type": "NumericDatatypeType", + "Decimals": "" + } + } + ], + "Control": [ + { + "post_collect": false, + "Description": "\"si inférieur à 10\"", + "Expression": "$MONTANTINDIV$ < 10", + "during_collect": false, + "criticity": "INFO", + "FailMessage": "\"inférieur à 10\"", + "id": "kyo4aofu" + } + ], + "depth": 3, + "FlowControl": [], + "Label": [ + "\"Montant entre 0 et 100 pour l'individu \" || $PRENOM$" + ], + "id": "kyo4bj5g", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [ + { + "declarationType": "HELP", + "Text": "\"Contrôles : un vérifie que saisie inférieure à 10 \"", + "id": "l7izilib", + "position": "AFTER_QUESTION_TEXT", + "DeclarationMode": [ + "CATI", + "CAWI", + "CAPI" + ] + } + ], + "type": "QuestionType", + "questionType": "SIMPLE", + "Name": "MONTANTINDIV" + } + ], + "Name": "ITERATION" + }, + { + "Control": [], + "depth": 2, + "FlowControl": [], + "genericName": "SUBMODULE", + "Label": [ + "Autre" + ], + "id": "kyo2vhbm", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "SequenceType", + "Child": [ + { + "Response": [ + { + "CollectedVariableReference": "kyo35o1j", + "id": "kyo2pqqn", + "mandatory": false, + "Datatype": { + "Pattern": "", + "typeName": "TEXT", + "type": "TextDatatypeType", + "MaxLength": 249 + } + } + ], + "Control": [], + "depth": 3, + "FlowControl": [], + "Label": [ + "FIN" + ], + "id": "kyo2xe36", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "QuestionType", + "questionType": "SIMPLE", + "Name": "FIN" + } + ], + "Name": "AUTRE" + } + ], + "Name": "S1" + }, + { + "Control": [], + "depth": 1, + "FlowControl": [], + "genericName": "MODULE", + "Label": [ + "QUESTIONNAIRE_END" + ], + "id": "idendquest", + "TargetMode": [ + "CATI", + "CAWI", + "CAPI" + ], + "Declaration": [], + "type": "SequenceType", + "Child": [], + "Name": "QUESTIONNAIRE_END" + } + ] +} \ No newline at end of file