From 23d086b6d034431c677286135ebc0d297bcbcae8 Mon Sep 17 00:00:00 2001
From: Nicolas ROCHE <nroche@entrouvert.com>
Date: Thu, 17 Nov 2022 07:51:08 +0100
Subject: [PATCH] toulouse-maelis: FSL removed from Parsifal project (#71387)

---
 passerelle/contrib/toulouse_maelis/models.py  |  46 --------
 passerelle/contrib/toulouse_maelis/schemas.py | 100 ------------------
 tests/data/toulouse_maelis/FamilyService.wsdl |   3 +-
 .../toulouse_maelis/Q_update_child_fsl.xml    |  38 -------
 tests/data/toulouse_maelis/R_read_family.xml  |  23 ----
 .../toulouse_maelis/R_read_family_relax.xml   |  23 ----
 .../R_read_family_reordered.xml               |  23 ----
 .../toulouse_maelis/R_update_child_fsl.xml    |   5 -
 tests/test_toulouse_maelis.py                 |  97 +----------------
 9 files changed, 2 insertions(+), 356 deletions(-)
 delete mode 100644 tests/data/toulouse_maelis/Q_update_child_fsl.xml
 delete mode 100644 tests/data/toulouse_maelis/R_update_child_fsl.xml

diff --git a/passerelle/contrib/toulouse_maelis/models.py b/passerelle/contrib/toulouse_maelis/models.py
index dbe3158a..1ecddb06 100644
--- a/passerelle/contrib/toulouse_maelis/models.py
+++ b/passerelle/contrib/toulouse_maelis/models.py
@@ -175,29 +175,16 @@ class ToulouseMaelis(BaseResource, HTTPResource):
         return data
 
     def add_text_value_to_child(self, data):
         self.add_text_value('Sex', data, ['sexe'])
         self.add_text_value('DietCode', data, ['dietcode'])
         self.add_text_value('PAI', data, ['paiInfoBean', 'code'])
         for person in data['authorizedPersonList']:
             self.add_text_value_to_child_person(person)
-
-        # convert O/N string into boolean
-        if data.get('fsl'):
-            for key in (
-                'allergieAlimentaire',
-                'allergieRespiratoire',
-                'allergieAutre',
-                'allergieMedicament',
-                'asthme',
-                'flPAI',
-                'flImage',
-            ):
-                data['fsl'][key] = bool(data['fsl'][key] == 'O')
         return data
 
     def add_text_value_to_person(self, data):
         self.add_text_value('Civility', data, ['civility'])
         self.add_text_value('Quality', data, ['quality'])
         self.add_text_value('Sex', data, ['sexe'])
 
     def add_text_value_to_rl(self, data):
@@ -1091,49 +1078,16 @@ class ToulouseMaelis(BaseResource, HTTPResource):
         # use None to empty date passed as an empty string by date filter
         for key in 'dateDeb', 'dateFin':
             if post_data[key] == '':
                 post_data[key] = None
 
         self.call('Family', 'updateChildPAI', personNumber=child_id, **post_data)
         return {'data': 'ok'}
 
-    @endpoint(
-        display_category='Famille',
-        description="Créer ou mettre à jour la fiche sanitaire d'un enfant",
-        name='update-child-fsl',
-        perm='can_access',
-        parameters={
-            'NameID': {'description': 'Publik NameID'},
-            'child_id': {'description': "Numéro de l'enfant"},
-        },
-        post={'request_body': {'schema': {'application/json': schemas.FSL_SCHEMA}}},
-    )
-    def update_child_fsl(self, request, NameID, child_id, post_data):
-        self.get_link(NameID)
-
-        # maelis expect strings O/N
-        for key in (
-            'allergieAlimentaire',
-            'allergieRespiratoire',
-            'allergieAutre',
-            'allergieMedicament',
-            'asthme',
-            'flPAI',
-            'flImage',
-        ):
-            post_data[key] = 'O' if post_data.get(key) else 'N'
-
-        # use None to empty optional date passed as an empty string by date filter
-        if post_data.get('dtcPrap1') == '':
-            post_data['dtcPrap1'] = None
-
-        self.call('Family', 'createOrUpdateFSL', arg0=child_id, arg1=post_data)
-        return {'data': 'ok'}
-
     @endpoint(
         display_category='Famille',
         description="Créer ou mettre à jour les données médicales d'un enfant",
         name='update-child-medical-record',
         perm='can_access',
         parameters={
             'NameID': {'description': 'Publik NameID'},
             'child_id': {'description': "Numéro de l'enfant"},
diff --git a/passerelle/contrib/toulouse_maelis/schemas.py b/passerelle/contrib/toulouse_maelis/schemas.py
index 026c49b9..a75332e2 100644
--- a/passerelle/contrib/toulouse_maelis/schemas.py
+++ b/passerelle/contrib/toulouse_maelis/schemas.py
@@ -241,113 +241,16 @@ CHILDBIRTH_SCHEMA = {
         },
         'place': {
             'description': 'Lieu de naissance',
             'oneOf': [{'type': 'string'}, {'type': 'null'}],
         },
     },
 }
 
-FSL_SCHEMA = {
-    '$schema': 'http://json-schema.org/draft-04/schema#',
-    'title': 'FSL',
-    'description': 'Informations sur la fiche sanitaire',
-    'type': 'object',
-    'properties': {
-        'dateDeb': {
-            'description': 'Date de début',
-            'type': 'string',
-            'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
-        },
-        'dateFin': {
-            'description': 'Date de fin',
-            'type': 'string',
-            'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
-        },
-        'allergieAlimentaire': {
-            'description': 'Allergie alimentaire',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'allergieRespiratoire': {
-            'description': 'Allergie respiratoire',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'allergieAutre': {
-            'description': 'Allergie autre',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'allergieMedicament': {
-            'description': 'Allergie médicament',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'asthme': {
-            'description': 'Asthmatique',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'flPAI': {
-            'description': 'PAI',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'flImage': {
-            'description': 'Autorisation photo',
-            'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
-        },
-        'dtcPrap1': {
-            'description': 'Date du dernier rappel DT Polio',
-            'type': 'string',
-            'pattern': '^([0-9]{4}-[0-9]{2}-[0-9]{2}){0,1}$',
-        },
-        'obsMed1': {
-            'description': 'Observation médecin 1',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsMed2': {
-            'description': 'Observation médecin 2',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsMed3': {
-            'description': 'Observation médecin 3',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsDir1': {
-            'description': 'Observation directeur 1',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsDir2': {
-            'description': 'Observation directeur 2',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsDir3': {
-            'description': 'Observation directeur 3',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsAssist1': {
-            'description': 'Observation assistant sanitaire 1',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsAssist2': {
-            'description': 'Observation assistant sanitaire 2',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'obsAssist3': {
-            'description': 'Observation assistant sanitaire 3',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'cons1Med': {
-            'description': 'Conseil médecin 1',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-        'cons2Med': {
-            'description': 'Conseil médecin 2',
-            'oneOf': [{'type': 'string'}, {'type': 'null'}],
-        },
-    },
-    'additionalProperties': False,
-}
-
 DOCTORADDRESS_SCHEMA = {
     '$schema': 'http://json-schema.org/draft-04/schema#',
     'title': 'Doctor address',
     'description': "Informations sur l'adresse du docteur",
     'type': 'object',
     'properties': {
         'street1': {
             'description': 'Libellé de la voie',
@@ -484,17 +387,16 @@ CHILD_SCHEMA = {
         'bPhoto': {
             'description': 'Autorisation photo',
             'oneOf': BOOLEAN_TYPES,
         },
         'bLeaveAlone': {
             'description': 'Autorisation à partir seul',
             'oneOf': BOOLEAN_TYPES,
         },
-        'fsl': {'oneOf': [FSL_SCHEMA, {'type': 'null'}]},
         'medicalRecord': {'oneOf': [MEDICALRECORD_SCHEMA, {'type': 'null'}]},
         'paiInfoBean': {'oneOf': [PAIINFO_SCHEMA, {'type': 'null'}]},
     },
     'additionalProperties': False,
 }
 CHILD_SCHEMA['properties'].update(ID_PROPERTIES)
 
 CONTACTLIGHT_SCHEMA = {
@@ -628,17 +530,16 @@ UPDATE_FAMILY_SCHEMA = {
     },
     'unflatten': True,
     'additionalProperties': False,
 }
 
 CREATE_FAMILY_SCHEMA = copy.deepcopy(UPDATE_FAMILY_SCHEMA)
 CREATE_FAMILY_SCHEMA['required'] = ['rl1', 'categorie', 'situation']
 create_family_child_schema = CREATE_FAMILY_SCHEMA['properties']['childList']['oneOf'][0]['items']
-del create_family_child_schema['properties']['fsl']
 del create_family_child_schema['properties']['bPhoto']
 del create_family_child_schema['properties']['bLeaveAlone']
 del create_family_child_schema['properties']['paiInfoBean']
 
 CREATE_RL1_SCHEMA = copy.deepcopy(CREATE_FAMILY_SCHEMA)
 del CREATE_RL1_SCHEMA['properties']['rl2']
 del CREATE_RL1_SCHEMA['properties']['authorizedPersonList']
 del CREATE_RL1_SCHEMA['properties']['emergencyPersonList']
@@ -660,17 +561,16 @@ del CREATE_RL2_SCHEMA['properties']['contact']
 del CREATE_RL2_SCHEMA['properties']['profession']
 del CREATE_RL2_SCHEMA['properties']['CAFInfo']
 
 UPDATE_RL2_SCHEMA = copy.deepcopy(UPDATE_RL1_SCHEMA)
 
 CREATE_CHILD_SCHEMA = copy.deepcopy(CHILD_SCHEMA)
 CREATE_CHILD_SCHEMA['unflatten'] = True
 del CREATE_CHILD_SCHEMA['properties']['dietcode']
-del CREATE_CHILD_SCHEMA['properties']['fsl']
 del CREATE_CHILD_SCHEMA['properties']['medicalRecord']
 del CREATE_CHILD_SCHEMA['properties']['paiInfoBean']
 
 UPDATE_CHILD_SCHEMA = copy.deepcopy(CREATE_CHILD_SCHEMA)
 
 UPDATE_COORDINATE_SCHEMA = {
     '$schema': 'http://json-schema.org/draft-04/schema#',
     'title': 'Update coordinate',
diff --git a/tests/data/toulouse_maelis/FamilyService.wsdl b/tests/data/toulouse_maelis/FamilyService.wsdl
index aa2a2d84..e44374b8 100644
--- a/tests/data/toulouse_maelis/FamilyService.wsdl
+++ b/tests/data/toulouse_maelis/FamilyService.wsdl
@@ -797,17 +797,16 @@
   <xs:complexType name="childInfoBean">
     <xs:sequence>
       <xs:element minOccurs="0" name="num" type="xs:string"/>
       <xs:element name="lastname" type="xs:string"/>
       <xs:element name="firstname" type="xs:string"/>
       <xs:element name="sexe" type="xs:string"/>
       <xs:element name="birth" type="tns:birthInfoBean"/>
       <xs:element minOccurs="0" name="dietcode" type="xs:string"/>
-      <xs:element minOccurs="0" name="fsl" type="ns1:fslBean"/>
       <xs:element minOccurs="0" name="bPhoto" type="xs:boolean"/>
       <xs:element minOccurs="0" name="bLeaveAlone" type="xs:boolean"/>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="authorizedPersonList" nillable="true" type="tns:relatedPersonBean"/>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="indicatorList" nillable="true" type="tns:indicatorBean"/>
       <xs:element minOccurs="0" name="medicalRecord" type="tns:medicalRecordBean"/>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="subscribeSchoolList" nillable="true" type="tns:subscribeSchoolBean"/>
       <xs:element minOccurs="0" name="mother" type="tns:personBean"/>
       <xs:element minOccurs="0" name="father" type="tns:personBean"/>
@@ -2719,9 +2718,9 @@ Cette méthode permet de mettre à jour les informations relatives au PAI pour u
       </wsdl:fault>
     </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="FamilyService">
     <wsdl:port binding="tns:FamilyServiceSoapBinding" name="FamilyServiceImplPort">
       <soap:address location="https://demo-toulouse.sigec.fr/maelisws-toulouse/services/FamilyService"/>
     </wsdl:port>
   </wsdl:service>
-</wsdl:definitions>
\ No newline at end of file
+</wsdl:definitions>
diff --git a/tests/data/toulouse_maelis/Q_update_child_fsl.xml b/tests/data/toulouse_maelis/Q_update_child_fsl.xml
deleted file mode 100644
index f47fa565..00000000
--- a/tests/data/toulouse_maelis/Q_update_child_fsl.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
-  <soap-env:Header>
-    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
-      <wsse:UsernameToken>
-        <wsse:Username>maelis-webservice</wsse:Username>
-        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">maelis-password</wsse:Password>
-      </wsse:UsernameToken>
-    </wsse:Security>
-  </soap-env:Header>
-  <soap-env:Body>
-    <ns0:createOrUpdateFSL xmlns:ns0="family.ws.maelis.sigec.com">
-      <arg0>613878</arg0>
-      <arg1>
-        <dateDeb>2022-01-01</dateDeb>
-        <dateFin>2022-12-31</dateFin>
-        <allergieAlimentaire>O</allergieAlimentaire>
-        <allergieRespiratoire>O</allergieRespiratoire>
-        <allergieAutre>O</allergieAutre>
-        <allergieMedicament>O</allergieMedicament>
-        <asthme>N</asthme>
-        <flPAI>N</flPAI>
-        <flImage>N</flImage>
-        <dtcPrap1>2022-02-22</dtcPrap1>
-        <obsMed1>some obsMed1 text</obsMed1>
-        <obsMed2>some obsMed2 text</obsMed2>
-        <obsMed3>some obsMed3 text</obsMed3>
-        <obsDir1>some obsDir1 text</obsDir1>
-        <obsDir2>some obsDir2 text</obsDir2>
-        <obsDir3>some obsDir3 text</obsDir3>
-        <obsAssist1>some obsAssist1 text</obsAssist1>
-        <obsAssist2>some obsAssist2 text</obsAssist2>
-        <obsAssist3>some obsAssist3 text</obsAssist3>
-        <cons1Med>some cons1Med text</cons1Med>
-        <cons2Med>some cons2Med text</cons2Med>
-      </arg1>
-    </ns0:createOrUpdateFSL>
-  </soap-env:Body>
-</soap-env:Envelope>
diff --git a/tests/data/toulouse_maelis/R_read_family.xml b/tests/data/toulouse_maelis/R_read_family.xml
index fa5a3a7f..20a6dd00 100644
--- a/tests/data/toulouse_maelis/R_read_family.xml
+++ b/tests/data/toulouse_maelis/R_read_family.xml
@@ -92,39 +92,16 @@
           <num>613880</num>
           <lastname>DOE</lastname>
           <firstname>JANNIS</firstname>
           <sexe>F</sexe>
           <birth>
             <dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
           </birth>
           <dietcode>RSV</dietcode>
-          <fsl>
-            <dateDeb>2022-01-01T00:00:00+01:00</dateDeb>
-            <dateFin>2022-12-31T00:00:00+01:00</dateFin>
-            <allergieAlimentaire>O</allergieAlimentaire>
-            <allergieRespiratoire>O</allergieRespiratoire>
-            <allergieAutre>O</allergieAutre>
-            <allergieMedicament>O</allergieMedicament>
-            <asthme>N</asthme>
-            <flPAI>N</flPAI>
-            <flImage>N</flImage>
-            <dtcPrap1>2022-02-22T00:00:00+01:00</dtcPrap1>
-            <obsMed1>some obsMed1 text</obsMed1>
-            <obsMed2>some obsMed2 text</obsMed2>
-            <obsMed3>some obsMed3 text</obsMed3>
-            <obsDir1>some obsDir1 text</obsDir1>
-            <obsDir2>some obsDir2 text</obsDir2>
-            <obsDir3>some obsDir3 text</obsDir3>
-            <obsAssist1>some obsAssist1 text</obsAssist1>
-            <obsAssist2>some obsAssist2 text</obsAssist2>
-            <obsAssist3>some obsAssist3 text</obsAssist3>
-            <cons1Med>some cons1Med text</cons1Med>
-            <cons2Med>some cons2Med text</cons2Med>
-          </fsl>
           <bPhoto>true</bPhoto>
           <bLeaveAlone>false</bLeaveAlone>
           <authorizedPersonList>
             <personInfo>
               <num>614719</num>
               <lastname>BENT</lastname>
               <firstname>AMEL</firstname>
               <dateBirth>1985-06-21T00:00:00+02:00</dateBirth>
diff --git a/tests/data/toulouse_maelis/R_read_family_relax.xml b/tests/data/toulouse_maelis/R_read_family_relax.xml
index 3cd75eb8..1ace41f1 100644
--- a/tests/data/toulouse_maelis/R_read_family_relax.xml
+++ b/tests/data/toulouse_maelis/R_read_family_relax.xml
@@ -91,39 +91,16 @@
           <num>613880</num>
           <lastname>DOE</lastname>
           <firstname>JANNIS</firstname>
           <sexe>F</sexe>
           <birth>
             <dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
           </birth>
           <dietcode>RSV</dietcode>
-          <fsl>
-            <dateDeb>2022-01-01T00:00:00+01:00</dateDeb>
-            <dateFin>2022-12-31T00:00:00+01:00</dateFin>
-            <allergieAlimentaire>O</allergieAlimentaire>
-            <allergieRespiratoire>O</allergieRespiratoire>
-            <allergieAutre>O</allergieAutre>
-            <allergieMedicament>O</allergieMedicament>
-            <asthme>N</asthme>
-            <flPAI>N</flPAI>
-            <flImage>N</flImage>
-            <dtcPrap1>2022-02-22T00:00:00+01:00</dtcPrap1>
-            <obsMed1>some obsMed1 text</obsMed1>
-            <obsMed2>some obsMed2 text</obsMed2>
-            <obsMed3>some obsMed3 text</obsMed3>
-            <obsDir1>some obsDir1 text</obsDir1>
-            <obsDir2>some obsDir2 text</obsDir2>
-            <obsDir3>some obsDir3 text</obsDir3>
-            <obsAssist1>some obsAssist1 text</obsAssist1>
-            <obsAssist2>some obsAssist2 text</obsAssist2>
-            <obsAssist3>some obsAssist3 text</obsAssist3>
-            <cons1Med>some cons1Med text</cons1Med>
-            <cons2Med>some cons2Med text</cons2Med>
-          </fsl>
           <bPhoto>true</bPhoto>
           <bLeaveAlone>false</bLeaveAlone>
           <authorizedPersonList>
             <personInfo>
               <num>614719</num>
               <lastname>BENT</lastname>
               <firstname>AMEL</firstname>
               <dateBirth>1985-06-21T00:00:00+02:00</dateBirth>
diff --git a/tests/data/toulouse_maelis/R_read_family_reordered.xml b/tests/data/toulouse_maelis/R_read_family_reordered.xml
index d6a4b5db..f1eb3bb3 100644
--- a/tests/data/toulouse_maelis/R_read_family_reordered.xml
+++ b/tests/data/toulouse_maelis/R_read_family_reordered.xml
@@ -92,39 +92,16 @@
           <num>613880</num>
           <lastname>DOE</lastname>
           <firstname>JANNIS</firstname>
           <sexe>F</sexe>
           <birth>
             <dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
           </birth>
           <dietcode>RSV</dietcode>
-          <fsl>
-            <dateDeb>2022-01-01T00:00:00+01:00</dateDeb>
-            <dateFin>2022-12-31T00:00:00+01:00</dateFin>
-            <allergieAlimentaire>O</allergieAlimentaire>
-            <allergieRespiratoire>O</allergieRespiratoire>
-            <allergieAutre>O</allergieAutre>
-            <allergieMedicament>O</allergieMedicament>
-            <asthme>N</asthme>
-            <flPAI>N</flPAI>
-            <flImage>N</flImage>
-            <dtcPrap1>2022-02-22T00:00:00+01:00</dtcPrap1>
-            <obsMed1>some obsMed1 text</obsMed1>
-            <obsMed2>some obsMed2 text</obsMed2>
-            <obsMed3>some obsMed3 text</obsMed3>
-            <obsDir1>some obsDir1 text</obsDir1>
-            <obsDir2>some obsDir2 text</obsDir2>
-            <obsDir3>some obsDir3 text</obsDir3>
-            <obsAssist1>some obsAssist1 text</obsAssist1>
-            <obsAssist2>some obsAssist2 text</obsAssist2>
-            <obsAssist3>some obsAssist3 text</obsAssist3>
-            <cons1Med>some cons1Med text</cons1Med>
-            <cons2Med>some cons2Med text</cons2Med>
-          </fsl>
           <bPhoto>true</bPhoto>
           <bLeaveAlone>false</bLeaveAlone>
           <authorizedPersonList>
             <personInfo>
               <num>614719</num>
               <lastname>BENT</lastname>
               <firstname>AMEL</firstname>
               <dateBirth>1985-06-21T00:00:00+02:00</dateBirth>
diff --git a/tests/data/toulouse_maelis/R_update_child_fsl.xml b/tests/data/toulouse_maelis/R_update_child_fsl.xml
deleted file mode 100644
index d263173c..00000000
--- a/tests/data/toulouse_maelis/R_update_child_fsl.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
-  <soap:Body>
-    <ns2:createOrUpdateFSLResponse xmlns:ns2="family.ws.maelis.sigec.com"/>
-  </soap:Body>
-</soap:Envelope>
diff --git a/tests/test_toulouse_maelis.py b/tests/test_toulouse_maelis.py
index dcbdd2fb..f0dd39f3 100644
--- a/tests/test_toulouse_maelis.py
+++ b/tests/test_toulouse_maelis.py
@@ -66,19 +66,17 @@ CREATE_FAMILY_ERR = FakedResponse(content=get_xml_file('R_create_family_error.xm
 CREATE_CHILD = FakedResponse(content=get_xml_file('R_create_child.xml'), status_code=200)
 CREATE_CHILD_ERR = FakedResponse(content=get_xml_file('R_create_child_error.xml'), status_code=200)
 UPDATE_FAMILY = FakedResponse(content=get_xml_file('R_update_family.xml'), status_code=200)
 UPDATE_FAMILY_ERR = FakedResponse(content=get_xml_file('R_update_family_error.xml'), status_code=200)
 UPDATE_FAMILY_500 = FakedResponse(content=get_xml_file('R_update_family_soap_error.xml'), status_code=500)
 UPDATE_DIETCODE = FakedResponse(content=get_xml_file('R_update_child_dietcode.xml'), status_code=200)
 UPDATE_PAI = FakedResponse(content=get_xml_file('R_update_child_pai.xml'), status_code=200)
 UPDATE_PAI_500 = FakedResponse(content=get_xml_file('R_update_child_pai_soap_error.xml'), status_code=500)
-UPDATE_FSL = FakedResponse(content=get_xml_file('R_update_child_fsl.xml'), status_code=200)
-UPDATE_FSL_500 = FakedResponse(content=get_xml_file('R_update_child_fsl_soap_error.xml'), status_code=500)
-UPDATE_MEDICAL = FakedResponse(content=get_xml_file('R_update_child_fsl.xml'), status_code=200)
+UPDATE_MEDICAL = FakedResponse(content=get_xml_file('R_update_child_medical_record.xml'), status_code=200)
 UPDATE_MEDICAL_500 = FakedResponse(
     content=get_xml_file('R_update_child_medical_record_soap_error.xml'), status_code=500
 )
 UPDATE_CHILD_AUTO = FakedResponse(content=get_xml_file('R_update_child_authorization.xml'), status_code=200)
 
 
 def assert_sent_payload(mocked_post, query_file):
     soap_sent = etree.tostring(etree.fromstring(mocked_post.call_args.kwargs['data']), pretty_print=True)
@@ -609,17 +607,16 @@ def test_read_family(mocked_post, mocked_get, read_family, con, app):
         },
         'CAFInfo': None,
         'civility_text': 'Monsieur',
         'quality_text': 'PERE',
         'quotientList': [],
         'subscribeActivityList': [],
     }
     data = resp.json['data']['childList'][0]
-    del data['fsl']
     del data['medicalRecord']
     del data['authorizedPersonList']
     del data['paiInfoBean']
     assert data == {
         'num': '613880',
         'lastname': 'DOE',
         'firstname': 'JANNIS',
         'sexe': 'F',
@@ -646,39 +643,16 @@ def test_read_family(mocked_post, mocked_get, read_family, con, app):
         }
     else:
         assert resp.json['data']['childList'][0]['paiInfoBean'] == {
             'code': None,
             'dateDeb': '2022-01-01T00:00:00+01:00',
             'dateFin': '2022-12-31T00:00:00+01:00',
             'description': 'bla bla PAI',
         }
-    assert resp.json['data']['childList'][0]['fsl'] == {
-        'dateDeb': '2022-01-01T00:00:00+01:00',
-        'dateFin': '2022-12-31T00:00:00+01:00',
-        'allergieAlimentaire': True,
-        'allergieRespiratoire': True,
-        'allergieAutre': True,
-        'allergieMedicament': True,
-        'asthme': False,
-        'flPAI': False,
-        'flImage': False,
-        'dtcPrap1': '2022-02-22T00:00:00+01:00',
-        'obsMed1': 'some obsMed1 text',
-        'obsMed2': 'some obsMed2 text',
-        'obsMed3': 'some obsMed3 text',
-        'obsDir1': 'some obsDir1 text',
-        'obsDir2': 'some obsDir2 text',
-        'obsDir3': 'some obsDir3 text',
-        'obsAssist1': 'some obsAssist1 text',
-        'obsAssist2': 'some obsAssist2 text',
-        'obsAssist3': 'some obsAssist3 text',
-        'cons1Med': 'some cons1Med text',
-        'cons2Med': 'some cons2Med text',
-    }
     assert resp.json['data']['childList'][0]['medicalRecord'] == {
         "familyDoctor": {
             "name": "DRE",
             "phone": "0612341234",
             "address": {"street1": "Alameda", "zipcode": "90220", "town": "Compton"},
         },
         "vaccinList": [
             {
@@ -2651,85 +2625,16 @@ def test_update_child_pai_soap_error(mocked_post, mocked_get, con, app):
     Link.objects.create(resource=con, family_id='1312', name_id='local')
     resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
     assert resp.json['err'] == 'Family-updateChildPAI-soap:Server'
     assert 'Une erreur est survenue' in resp.json['err_desc']
     assert 'valeur trop grande' in resp.json['err_desc']
     assert 'maximum : 500' in resp.json['err_desc']
 
 
-@mock.patch('passerelle.utils.Request.get')
-@mock.patch('passerelle.utils.Request.post')
-def test_update_child_fsl(mocked_post, mocked_get, con, app):
-    mocked_get.return_value = FAMILY_SERVICE_WSDL
-    mocked_post.return_value = UPDATE_FSL
-    url = get_endpoint('update-child-fsl')
-    params = {
-        'dateDeb': '2022-01-01',
-        'dateFin': '2022-12-31',
-        'allergieAlimentaire': True,
-        'allergieRespiratoire': True,
-        'allergieAutre': True,
-        'allergieMedicament': True,
-        'asthme': False,
-        'flPAI': False,
-        'flImage': False,
-        'dtcPrap1': '2022-02-22',
-        'obsMed1': 'some obsMed1 text',
-        'obsMed2': 'some obsMed2 text',
-        'obsMed3': 'some obsMed3 text',
-        'obsDir1': 'some obsDir1 text',
-        'obsDir2': 'some obsDir2 text',
-        'obsDir3': 'some obsDir3 text',
-        'obsAssist1': 'some obsAssist1 text',
-        'obsAssist2': 'some obsAssist2 text',
-        'obsAssist3': 'some obsAssist3 text',
-        'cons1Med': 'some cons1Med text',
-        'cons2Med': 'some cons2Med text',
-    }
-
-    Link.objects.create(resource=con, family_id='1312', name_id='local')
-    resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
-    assert_sent_payload(mocked_post, 'Q_update_child_fsl.xml')
-    assert resp.json['err'] == 0
-    assert resp.json['data'] == 'ok'
-
-
-def test_update_child_fsl_not_linked_error(con, app):
-    url = get_endpoint('update-child-fsl')
-    params = {
-        'dateDeb': '2022-01-01',
-        'dateFin': '2022-12-31',
-    }
-
-    resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
-    assert resp.json['err'] == 'not-linked'
-    assert resp.json['err_desc'] == 'User not linked to family'
-
-
-@mock.patch('passerelle.utils.Request.get')
-@mock.patch('passerelle.utils.Request.post')
-def test_update_child_fsl_soap_error(mocked_post, mocked_get, con, app):
-    mocked_get.return_value = FAMILY_SERVICE_WSDL
-    mocked_post.return_value = UPDATE_FSL_500
-    url = get_endpoint('update-child-fsl')
-    params = {
-        'dateDeb': '2022-01-01',
-        'dateFin': '2022-12-31',
-        'obsMed1': 'a' * 71,
-    }
-
-    Link.objects.create(resource=con, family_id='1312', name_id='local')
-    resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
-    assert resp.json['err'] == 'Family-createOrUpdateFSL-soap:Server'
-    assert 'Une erreur est survenue' in resp.json['err_desc']
-    assert 'valeur trop grande' in resp.json['err_desc']
-    assert 'maximum : 70' in resp.json['err_desc']
-
-
 @mock.patch('passerelle.utils.Request.get')
 @mock.patch('passerelle.utils.Request.post')
 def test_update_child_medical_record(mocked_post, mocked_get, con, app):
     mocked_get.return_value = FAMILY_SERVICE_WSDL
     mocked_post.side_effect = [READ_VACCIN, UPDATE_MEDICAL]
     url = get_endpoint('update-child-medical-record')
     params = {
         'familyDoctor/name': 'Dre',
-- 
2.30.2

