InseeFr / Eno

Questionnaire generator
MIT License
13 stars 24 forks source link

Support for Regexp format control #536

Open romaintailhurat opened 1 year ago

romaintailhurat commented 1 year ago

🇬🇧 In Pogues, a text field can be checked by a regular expression ("Pattern" field). This data is not propagated through Eno, it should.

🇫🇷 Dans Pogues, un champ texte peut être contrôlé par une expression régulière (champ "Motif"). Cette information n'est pas propagée par Eno, elle devrait l'être

Exemple DDI pour un SIRET:

<d:StructuredMixedGridResponseDomain>
    <d:GridResponseDomainInMixed>
        <d:TextDomain minLength="14" maxLength="14" regExp="^[0-9]{14}$">
            <r:OutParameter isArray="false">
                <r:Agency>fr.insee</r:Agency>
                <r:ID>jl3j68kq-RDOP-khkavybv</r:ID>
                <r:Version>1</r:Version>
                <r:TextRepresentation minLength="14" maxLength="14" regExp="^[0-9]{14}$"/>
            </r:OutParameter>
        </d:TextDomain>
        <d:GridAttachment>
            <d:CellCoordinatesAsDefined>
                <d:SelectDimension rank="1" rangeMinimum="1" rangeMaximum="1"/>
                <d:SelectDimension rank="2" rangeMinimum="1" rangeMaximum="1"/>
            </d:CellCoordinatesAsDefined>
        </d:GridAttachment>
    </d:GridResponseDomainInMixed>
</d:StructuredMixedGridResponseDomain>
<l:Variable>
    <r:Agency>fr.insee</r:Agency>
    <r:ID>k0xxby2u</r:ID>
    <r:Version>1</r:Version>
    <l:VariableName>
        <r:String xml:lang="fr-FR">REGROUP</r:String>
    </l:VariableName>
    <r:Label>
        <r:Content xml:lang="fr-FR">Numéro Siret</r:Content>
    </r:Label>
    <r:SourceParameterReference>
        <r:Agency>fr.insee</r:Agency>
        <r:ID>jl3j68kq-QOP-khkavybv</r:ID>
        <r:Version>1</r:Version>
        <r:TypeOfObject>OutParameter</r:TypeOfObject>
    </r:SourceParameterReference>
    <r:QuestionReference>
        <r:Agency>fr.insee</r:Agency>
        <r:ID>jl3j68kq</r:ID>
        <r:Version>1</r:Version>
        <r:TypeOfObject>QuestionGrid</r:TypeOfObject>
    </r:QuestionReference>
    <l:VariableRepresentation>
        <r:TextRepresentation minLength="14" maxLength="14" regExp="^[0-9]{14}$"/>
    </l:VariableRepresentation>
</l:Variable>

au lieu de

<l:Variable>
            <r:Agency>fr.insee</r:Agency>
            <r:ID>lhqc1fyf</r:ID>
            <r:Version>1</r:Version>
            <l:VariableName>
               <r:String xml:lang="fr-FR">Q1</r:String>
            </l:VariableName>
            <r:Label>
               <r:Content xml:lang="fr-FR">Q1 label </r:Content>
            </r:Label>
            <r:SourceParameterReference>
               <r:Agency>fr.insee</r:Agency>
               <r:ID>jfazk91m-QOP-jfazhq57</r:ID>
               <r:Version>1</r:Version>
               <r:TypeOfObject>OutParameter</r:TypeOfObject>
            </r:SourceParameterReference>
            <r:QuestionReference>
               <r:Agency>fr.insee</r:Agency>
               <r:ID>jfazk91m</r:ID>
               <r:Version>1</r:Version>
               <r:TypeOfObject>QuestionItem</r:TypeOfObject>
            </r:QuestionReference>
            <l:VariableRepresentation>
               <r:TextRepresentation maxLength="14"/>
            </l:VariableRepresentation>
         </l:Variable>
AnneHuSKa commented 1 year ago

Exemple.zip

AnneHuSKa commented 2 weeks ago

A ce jour :