61 |
61 |
'title': 'Exist',
|
62 |
62 |
'description': "Recherche d'un responsable légal ou d'un enfant dans Maelis",
|
63 |
63 |
'type': 'object',
|
64 |
64 |
'required': ['firstname', 'lastname', 'dateBirth'],
|
65 |
65 |
'properties': BASIC_ID_PROPERTIES,
|
66 |
66 |
'additionalProperties': False,
|
67 |
67 |
}
|
68 |
68 |
|
|
69 |
|
|
70 |
CONTACTLIGHT_SCHEMA = {
|
|
71 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
|
72 |
'title': 'Contact light',
|
|
73 |
'description': "Informations de contact pour les personnes autorisées à récupérer les enfants ou à prévenir en cas d'urgence",
|
|
74 |
'type': 'object',
|
|
75 |
'properties': {
|
|
76 |
'phone': {
|
|
77 |
'description': 'Téléphone',
|
|
78 |
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
|
79 |
},
|
|
80 |
'mobile': {
|
|
81 |
'description': 'Portable',
|
|
82 |
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
|
83 |
},
|
|
84 |
'mail': {
|
|
85 |
'description': 'Mail',
|
|
86 |
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
|
87 |
},
|
|
88 |
},
|
|
89 |
}
|
|
90 |
|
|
91 |
|
|
92 |
PERSON_PROPERTIES = {
|
|
93 |
'civility': {
|
|
94 |
'description': 'civilité (depuis référentiel)',
|
|
95 |
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
|
96 |
},
|
|
97 |
'sexe': {
|
|
98 |
'description': 'Sexe (depuis référentiel)',
|
|
99 |
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
|
100 |
},
|
|
101 |
'contact': {'oneOf': [CONTACTLIGHT_SCHEMA, {'type': 'null'}]},
|
|
102 |
}
|
|
103 |
PERSON_PROPERTIES.update(BASIC_ID_PROPERTIES)
|
|
104 |
|
|
105 |
|
|
106 |
EMERGENCY_PERSON_SCHEMA = {
|
|
107 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
|
108 |
'title': 'Emergency person',
|
|
109 |
'description': "Personnes à prévenir en cas d'urgence",
|
|
110 |
'type': 'object',
|
|
111 |
'required': ['firstname', 'lastname', 'dateBirth', 'quality'],
|
|
112 |
'properties': {
|
|
113 |
'quality': {
|
|
114 |
'description': 'Qualité',
|
|
115 |
'type': 'string',
|
|
116 |
'pattern': '.+',
|
|
117 |
},
|
|
118 |
},
|
|
119 |
'unflatten': True,
|
|
120 |
'additionalProperties': False,
|
|
121 |
}
|
|
122 |
EMERGENCY_PERSON_SCHEMA['properties'].update(PERSON_PROPERTIES)
|
|
123 |
|
|
124 |
|
|
125 |
EMERGENCY_PERSON_LIST_SCHEMA = {
|
|
126 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
|
127 |
'title': 'Family persons',
|
|
128 |
'description': "Liste des personnes à prévenir en cas d'urgence",
|
|
129 |
'type': 'object',
|
|
130 |
'properties': {
|
|
131 |
'personList': {
|
|
132 |
'oneOf': [
|
|
133 |
{
|
|
134 |
'type': 'array',
|
|
135 |
'items': EMERGENCY_PERSON_SCHEMA,
|
|
136 |
},
|
|
137 |
{'type': 'null'},
|
|
138 |
],
|
|
139 |
},
|
|
140 |
},
|
|
141 |
}
|
|
142 |
|
|
143 |
|
|
144 |
AUTHORIZED_PERSON_SCHEMA = {
|
|
145 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
|
146 |
'title': 'Family persons',
|
|
147 |
'description': "Personnes autorisées à venir chercher l'enfant",
|
|
148 |
'type': 'object',
|
|
149 |
'required': ['personInfo', 'personQuality'],
|
|
150 |
'properties': {
|
|
151 |
'personInfo': {
|
|
152 |
'type': 'object',
|
|
153 |
'required': ['firstname', 'lastname', 'dateBirth'],
|
|
154 |
'properties': PERSON_PROPERTIES,
|
|
155 |
},
|
|
156 |
'personQuality': {
|
|
157 |
'type': 'object',
|
|
158 |
'required': ['code'],
|
|
159 |
'properties': {
|
|
160 |
'code': {
|
|
161 |
'description': 'Le code (depuis référentiel)',
|
|
162 |
'type': 'string',
|
|
163 |
'pattern': '.+',
|
|
164 |
},
|
|
165 |
},
|
|
166 |
},
|
|
167 |
},
|
|
168 |
'additionalProperties': False,
|
|
169 |
'unflatten': True,
|
|
170 |
}
|
|
171 |
|
|
172 |
|
69 |
173 |
BIRTH_SCHEMA = {
|
70 |
174 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
71 |
175 |
'title': 'Birth info',
|
72 |
176 |
'description': "Informations relatives à la naissance",
|
73 |
177 |
'type': 'object',
|
74 |
178 |
'required': ['dateBirth'],
|
75 |
179 |
'properties': {
|
76 |
180 |
'dateBirth': {
|
... | ... | |
448 |
552 |
},
|
449 |
553 |
'medicalRecord': {'oneOf': [MEDICALRECORD_SCHEMA, {'type': 'null'}]},
|
450 |
554 |
'paiInfoBean': {'oneOf': [PAIINFO_SCHEMA, {'type': 'null'}]},
|
451 |
555 |
},
|
452 |
556 |
'additionalProperties': False,
|
453 |
557 |
}
|
454 |
558 |
CHILD_SCHEMA['properties'].update(ID_PROPERTIES)
|
455 |
559 |
|
456 |
|
CONTACTLIGHT_SCHEMA = {
|
457 |
|
'$schema': 'http://json-schema.org/draft-04/schema#',
|
458 |
|
'title': 'Contact light',
|
459 |
|
'description': "Informations de contact pour les personnes autorisées à récupérer les enfants ou à prévenir en cas d'urgence",
|
460 |
|
'type': 'object',
|
461 |
|
'properties': {
|
462 |
|
'phone': {
|
463 |
|
'description': 'Téléphone',
|
464 |
|
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
465 |
|
},
|
466 |
|
'mobile': {
|
467 |
|
'description': 'Portable',
|
468 |
|
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
469 |
|
},
|
470 |
|
'mail': {
|
471 |
|
'description': 'Mail',
|
472 |
|
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
473 |
|
},
|
474 |
|
},
|
475 |
|
}
|
476 |
|
|
477 |
|
FAMILYPERSON_SCHEMA = {
|
478 |
|
'$schema': 'http://json-schema.org/draft-04/schema#',
|
479 |
|
'title': 'Family person',
|
480 |
|
'description': "Informations sur les personnes autorisées à venir chercher les enfants ou à prévenir en cas d'urgence",
|
481 |
|
'type': 'object',
|
482 |
|
'required': ['firstname', 'lastname', 'dateBirth', 'quality'],
|
483 |
|
'properties': {
|
484 |
|
'civility': {
|
485 |
|
'description': 'civilité (depuis référentiel)',
|
486 |
|
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
487 |
|
},
|
488 |
|
'quality': {
|
489 |
|
'description': 'Qualité',
|
490 |
|
'type': 'string',
|
491 |
|
'pattern': '.+',
|
492 |
|
},
|
493 |
|
'sexe': {
|
494 |
|
'description': 'Sexe (depuis référentiel)',
|
495 |
|
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
496 |
|
},
|
497 |
|
'contact': {'oneOf': [CONTACTLIGHT_SCHEMA, {'type': 'null'}]},
|
498 |
|
},
|
499 |
|
'unflatten': True,
|
500 |
|
'additionalProperties': False,
|
501 |
|
}
|
502 |
|
FAMILYPERSON_SCHEMA['properties'].update(BASIC_ID_PROPERTIES)
|
503 |
|
|
504 |
|
AUTHORIZEDPERSON_SCHEMA = {
|
505 |
|
'$schema': 'http://json-schema.org/draft-04/schema#',
|
506 |
|
'title': 'Family persons',
|
507 |
|
'description': "Informations sur les personnes autorisées à venir chercher les enfants ou à prévenir en cas d'urgence",
|
508 |
|
'type': 'object',
|
509 |
|
'properties': {
|
510 |
|
'personList': {
|
511 |
|
'oneOf': [
|
512 |
|
{
|
513 |
|
'type': 'array',
|
514 |
|
'items': FAMILYPERSON_SCHEMA,
|
515 |
|
},
|
516 |
|
{'type': 'null'},
|
517 |
|
],
|
518 |
|
},
|
519 |
|
},
|
520 |
|
}
|
521 |
|
|
522 |
560 |
UPDATE_FAMILY_SCHEMA = {
|
523 |
561 |
'$schema': 'http://json-schema.org/draft-04/schema#',
|
524 |
562 |
'title': 'Family',
|
525 |
563 |
'description': 'Informations pour créer ou mettre à jour une famille',
|
526 |
564 |
'type': 'object',
|
527 |
565 |
'required': ['category', 'situation'],
|
528 |
566 |
'properties': {
|
529 |
567 |
'category': {
|
... | ... | |
553 |
591 |
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
554 |
592 |
},
|
555 |
593 |
'rl1': RLINFO_SCHEMA,
|
556 |
594 |
'rl2': RLINFO_SCHEMA,
|
557 |
595 |
'emergencyPersonList': {
|
558 |
596 |
'oneOf': [
|
559 |
597 |
{
|
560 |
598 |
'type': 'array',
|
561 |
|
'items': AUTHORIZEDPERSON_SCHEMA,
|
|
599 |
'items': EMERGENCY_PERSON_LIST_SCHEMA,
|
562 |
600 |
},
|
563 |
601 |
{'type': 'null'},
|
564 |
602 |
],
|
565 |
603 |
},
|
566 |
604 |
'childList': {
|
567 |
605 |
'oneOf': [
|
568 |
606 |
{
|
569 |
607 |
'type': 'array',
|
... | ... | |
621 |
659 |
'adresse': ADDRESS_SCHEMA,
|
622 |
660 |
'contact': {'oneOf': [CONTACT_SCHEMA, {'type': 'null'}]},
|
623 |
661 |
'profession': {'oneOf': [PROFESSION_SCHEMA, {'type': 'null'}]},
|
624 |
662 |
'CAFInfo': {'oneOf': [CAFINFO_SCHEMA, {'type': 'null'}]},
|
625 |
663 |
},
|
626 |
664 |
'unflatten': True,
|
627 |
665 |
'additionalProperties': False,
|
628 |
666 |
}
|
629 |
|
|
630 |
|
CHILDPERSON_SCHEMA = copy.deepcopy(FAMILYPERSON_SCHEMA)
|
631 |
|
CHILDPERSON_SCHEMA['required'] = ['firstname', 'lastname', 'dateBirth']
|
632 |
|
del CHILDPERSON_SCHEMA['properties']['quality']
|
633 |
|
|
634 |
|
PERSONQUALITY_SCHEMA = {
|
635 |
|
'$schema': 'http://json-schema.org/draft-04/schema#',
|
636 |
|
'title': 'Child person quality',
|
637 |
|
'description': "Informations sur la qualité des personnes autorisées à venir chercher l'enfant",
|
638 |
|
'type': 'object',
|
639 |
|
'required': ['code'],
|
640 |
|
'properties': {
|
641 |
|
'code': {
|
642 |
|
'description': 'Le code (depuis référentiel)',
|
643 |
|
'type': 'string',
|
644 |
|
'pattern': '.+',
|
645 |
|
},
|
646 |
|
},
|
647 |
|
}
|
648 |
|
|
649 |
|
CHILDPERSON2_SCHEMA = {
|
650 |
|
'$schema': 'http://json-schema.org/draft-04/schema#',
|
651 |
|
'title': 'Family persons',
|
652 |
|
'description': "Informations sur les personnes autorisées à venir chercher l'enfant avec leur qualité",
|
653 |
|
'type': 'object',
|
654 |
|
'required': ['personInfo', 'personQuality'],
|
655 |
|
'properties': {
|
656 |
|
'personInfo': CHILDPERSON_SCHEMA,
|
657 |
|
'personQuality': PERSONQUALITY_SCHEMA,
|
658 |
|
},
|
659 |
|
'unflatten': True,
|
660 |
|
}
|
661 |
|
-
|