InseeFr / Pogues-Model

Classes and converters for the Pogues data model
MIT License
2 stars 8 forks source link

Pairwise modelisation (missing SymLink) #69

Open ORogel opened 2 years ago

ORogel commented 2 years ago

To implement : https://github.com/InseeFr/Umbrella/issues/2 in link with : https://github.com/InseeFr/Pogues/issues/601

ORogel commented 2 years ago

🇫🇷 Suggestion : ajout d'un type de réponse "Lien deux à deux" avec un paramètre contenant la variable présentant les membres du foyer.

🇬🇧 Suggestion: Added a "Pairwise" response type with a parameter containing the variable presenting household members.

ORogel commented 2 years ago

Response :

          "Response": [
            {
              "CollectedVariableReference": "k5o13pjw",
              "id": "jbgdhaht",
              "mandatory": true,
              "Datatype": {
                "typeName": "PAIRWISE",
                "type": "PairwiseDatatypeType",
                "scope": "jbgd3set"
              }]

xsd :


  <xs:simpleType name="DatatypeTypeEnum">
    <xs:restriction base="xs:token">
      <xs:enumeration value="BOOLEAN"/>
      <xs:enumeration value="DATE"/>
      <xs:enumeration value="DURATION"/>
      <xs:enumeration value="NUMERIC"/>
      <xs:enumeration value="TEXT"/>
      <xs:enumeration value="PAIRWISE"/>
    </xs:restriction>
  </xs:simpleType>
....
  <xs:complexType name="PairwiseDatatypeType">
    <xs:complexContent>
      <xs:extension base="DatatypeType">
        <xs:sequence>
          <xs:element name="Scope" type="xs:token" minOccurs="1" maxOccurs="1">
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
ORogel commented 1 year ago

Autre proposition : seul le type de la question est impacté, pas le type de réponse (liste).

            {
              "Response": [
                {
                  "CollectedVariableReference": "l8ekksjd",
                  "id": "l8ekocae",
                  "mandatory": false,
                  "CodeListReference": "l8ek40jz",
                  "Datatype": {
                    "Pattern": "",
                    "typeName": "TEXT",
                    "visualizationHint": "DROPDOWN",
                    "type": "TextDatatypeType",
                    "MaxLength": 1
                  }
                }
              ],
              "Control": [],
              "depth": 3,
              "FlowControl": [],
              "Label": [
                "\"Quel est le lien de PRENOM avec les habitants du logement situé à l’adresse ADR ?\" "
              ],
              "ClarificationQuestion": [],
              "id": "l8ehb20u",
              "TargetMode": [
                "CAPI",
                "CATI",
                "CAWI",
                "PAPI"
              ],
              "Declaration": [],
              "type": "QuestionType",
              "questionType": "PAIRWISE",
              "scope": "l14vew0k", 
              "Name": "LIENS"
            }

d'où xsd :


 <xs:simpleType name="QuestionTypeEnum">
    <xs:restriction base="xs:token">
      <xs:enumeration value="SIMPLE">
        <xs:annotation>
          <xs:documentation>a SIMPLE question is a question made of a label and only one response
            domain whichever its type be: text, numeric, date, boolean, or less frequently any type
            available in the DDI schemas.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SINGLE_CHOICE">
        <xs:annotation>
          <xs:documentation>a SINGLE_CHOICE question is a question made of a label and a response
            domain typed as a code list. This type of question allows to the respondent to select
            one single response from a predefined list.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MULTIPLE_CHOICE">
        <xs:annotation>
          <xs:documentation>A MULTIPLE_CHOICE question is a question whose label is the mutual part
            of several sub-questions (constituting a coherent whole i.e an information axis). Each
            modality of the information axis is peculiar to a specific response domain. This type of
            question allows to the respondent to select the best possible answers out of a number of
            choices from a predefined list.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TABLE">
        <xs:annotation>
          <xs:documentation>A TABLE is a two-way table. It's a question made of a label and a
            response domain defined by two dimensions. The information located at the intersection
            of a row and a column corresponds to a response. </xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PAIRWISE">
        <xs:annotation>
          <xs:documentation>When surveying households, we distinguish the household and the individual members of the household. In order to properly set up the questionnaire, we want to map individuals relationships, in fact pairing them.
            Moreover, as far as possible we would like to infer some relationships instead of asking redundant questions. 
            For example, if Alice is the mother of Bob, then Bob is the child of Alice.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
....
  <xs:element name="Question" type="QuestionType"/>
  <xs:complexType name="QuestionType">
    <xs:complexContent>
      <xs:extension base="ComponentType">
        <xs:sequence>
          <xs:element name="Response" type="ResponseType" maxOccurs="unbounded"/>
          <xs:element name="ResponseStructure" type="ResponseStructureType" minOccurs="0"/>
          <xs:element name="ClarificationQuestion" type="QuestionType" minOccurs="0"
            maxOccurs="unbounded">
          <xs:element name="Scope" type="xs:token" minOccurs="0"
            maxOccurs="1">
            <xs:annotation>
              <xs:documentation>Clarification question is a request for additional information from
                a list of choices defined a priori (single or multiple choice question). This
                additional information is related to a response domain and triggered when a specific
                response value is selected or typed. The triggering of the clarification question
                can be made through the FlowControl element and the CLARIFICATION
                flowControlType.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="questionType" type="QuestionTypeEnum"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
laurentC35 commented 1 year ago

Il manque les SymLink (en dur actuellement)