toulouse-maelis: vaccin code and date are required (#71641)

This commit is contained in:
Nicolas Roche 2022-11-18 14:10:51 +01:00
parent 2d34e5b032
commit b4b2ab0e5f
4 changed files with 10 additions and 2 deletions

View File

@ -290,10 +290,11 @@ VACCIN_SCHEMA = {
'title': 'Vaccin',
'description': "Informations sur le vaccin",
'type': 'object',
'required': ['code', 'vaccinationDate'],
'properties': {
'code': {
'description': 'Code du vaccin (depuis référentiel)',
'oneOf': [{'type': 'string'}, {'type': 'null'}],
'type': 'string',
},
'label': {
'description': 'Nom du vaccin',

View File

@ -40,6 +40,7 @@
<medicalRecord>
<vaccinList>
<code>DTC</code>
<vaccinationDate>1940-07-26</vaccinationDate>
</vaccinList>
</medicalRecord>
</childList>

View File

@ -44,6 +44,7 @@
<medicalRecord>
<vaccinList>
<code>DTC</code>
<vaccinationDate>1940-07-26</vaccinationDate>
</vaccinList>
</medicalRecord>
<paiInfoBean>

View File

@ -1046,6 +1046,7 @@ def test_create_family(mocked_post, mocked_get, con, app):
'childList/0/dateBirth': '1941-05-24',
'childList/0/dietcode': 'RSV',
'childList/0/medicalRecord/vaccinList/0/code': 'DTC',
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
}
resp = app.post_json(url + '?NameID=local', params=params)
@ -1166,6 +1167,7 @@ def test_create_family_wrong_referential_key_error(mocked_post, mocked_get, con,
'childList/0/dateBirth': '1941-05-24',
'childList/0/dietcode': 'RSV',
'childList/0/medicalRecord/vaccinList/0/code': 'plop',
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
}
resp = app.post_json(url + '?NameID=local', params=params)
@ -1221,6 +1223,7 @@ def test_update_family(mocked_post, mocked_get, con, app):
'childList/0/dietcode': 'RSV',
'childList/0/paiInfoBean/code': 'PAIALI',
'childList/0/medicalRecord/vaccinList/0/code': 'DTC',
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
}
Link.objects.create(resource=con, family_id='1312', name_id='local')
@ -1347,6 +1350,7 @@ def test_update_family_wrong_referential_key_error(mocked_post, mocked_get, con,
'childList/0/dietcode': 'RSV',
'childList/0/paiInfoBean/code': 'PAIALI',
'childList/0/medicalRecord/vaccinList/0/code': 'plop',
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
}
Link.objects.create(resource=con, family_id='1312', name_id='local')
@ -2666,9 +2670,10 @@ def test_update_child_medical_record_not_linked_error(con, app):
@mock.patch('passerelle.utils.Request.post')
def test_update_child_medical_record_soap_error(mocked_post, mocked_get, con, app):
mocked_get.return_value = FAMILY_SERVICE_WSDL
mocked_post.side_effect = [UPDATE_MEDICAL_500]
mocked_post.side_effect = [READ_VACCIN, UPDATE_MEDICAL_500]
url = get_endpoint('update-child-medical-record')
params = {
'vaccinList/0/code': 'DTC',
'vaccinList/0/vaccinationDate': '2022-02-31',
}