Skip to content

Comments

feat: qcu options based on loop response#182

Merged
RemiVerriez merged 10 commits intomainfrom
feat/qcu-options-based-on-loop-response
Feb 17, 2026
Merged

feat: qcu options based on loop response#182
RemiVerriez merged 10 commits intomainfrom
feat/qcu-options-based-on-loop-response

Conversation

@RemiVerriez
Copy link
Contributor

@RemiVerriez RemiVerriez commented Feb 13, 2026

Schema changes

Introduced a new enum ChoiceTypeEnum with values:

  • CODE_LIST (default)
  • VARIABLE
  • SUGGESTER

Added a new attribute choiceType to QuestionType (default: CODE_LIST)

Added a new element OptionFilter to QuestionType

Added a new element VariableReference to ResponseType

Tests

Added JSON deserialization tests covering:

  • Explicit choiceType
  • Default value handling (CODE_LIST)
  • OptionFilter mapping
  • VariableReference mapping
  • Full combined configuration

Added JSON serialization test to ensure correct output generation.

</xs:enumeration>
<xs:enumeration value="SUGGESTER">
<xs:annotation>
<xs:documentation>For a large list of codes, such as a nomenclature, this component is used to suggest the sublist of codes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a line saying that this parameter will (hopefully) soon to be deprecated ? (replaced by choiceType), it should stay here for now only for retro-compatibility

</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="VARIABLE_RESPONSES">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo here, it's VARIABLE instead of VARIABLE_RESPONSES

@RemiVerriez RemiVerriez requested a review from MailineN February 16, 2026 15:15
Copy link
Contributor

@nsenave nsenave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

quelques remarques ; pas forcément besoin de retoucher le code

<xs:complexType name="ResponseType">
<xs:sequence>
<xs:element name="CodeListReference" type="xs:token" minOccurs="0"/>
<xs:element name="VariableReference" type="xs:token" minOccurs="0">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

à vérifier que le front de pogues mets une majuscule au début du nom de la prop (je trouve pas de PR sur le dépôt de pogues)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est good


assertTrue(json.contains("\"choiceType\":\"VARIABLE\""));
assertTrue(json.contains("\"OptionFilter\":\"nvl($AGE$, 0) > 18\""));
assertTrue(json.contains("\"VariableReference\":\"id-loop-variable\""));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

privilégier des tests avec JSONAssert en général pour du contenu json mais ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 pour le formatting plus cohérent, mais à privilégier dans une PR / commit sur branche de dev style: ... pour rendre les changements facile à suivre

"id-loop-variable",
question.getResponse().getFirst().getVariableReference()
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on pourrait grouper quelques-unes de ces méthodes de test mais ok

</xs:annotation>
</xs:element>
<xs:element name="OptionFilter" type="xs:string" minOccurs="0">
<xs:annotation>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pareil que pour "VariableReference", à vérifier que la prop commence aussi par une majuscule côté front


NB : historiquement dans Pogues-Model, la plupart des props avaient cette convention de nommage, mais c'est pas dans les standards json (notamment) donc on essaye de respecter le format somePropName pour les nouvelles props

Copy link

@MailineN MailineN Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas encore décidé ni implémenté pour l'instant, je ne suis même plus sure si c'est dans le cadre de la carte

UPDATE: non

@RemiVerriez RemiVerriez merged commit aac0dd9 into main Feb 17, 2026
1 check passed
@RemiVerriez RemiVerriez deleted the feat/qcu-options-based-on-loop-response branch February 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants