@@ -10,12 +10,12 @@ class CarteVitaleV1(Document):
1010
1111 given_names : List [TextField ]
1212 """The given name(s) of the card holder."""
13- surname : TextField
14- """The surname of the card holder."""
15- social_security : TextField
16- """The Social Security Number (Numéro de Sécurité Sociale) of the card holder"""
1713 issuance_date : DateField
1814 """The date the card was issued."""
15+ social_security : TextField
16+ """The Social Security Number (Numéro de Sécurité Sociale) of the card holder"""
17+ surname : TextField
18+ """The surname of the card holder."""
1919
2020 def __init__ (
2121 self ,
@@ -51,30 +51,35 @@ def _build_from_api_prediction(
5151 TextField (prediction , page_id = page_n )
5252 for prediction in api_prediction ["given_names" ]
5353 ]
54- self .surname = TextField (
55- api_prediction ["surname " ],
54+ self .issuance_date = DateField (
55+ api_prediction ["issuance_date " ],
5656 page_id = page_n ,
5757 )
5858 self .social_security = TextField (
5959 api_prediction ["social_security" ],
6060 page_id = page_n ,
6161 )
62- self .issuance_date = DateField (
63- api_prediction ["issuance_date " ],
62+ self .surname = TextField (
63+ api_prediction ["surname " ],
6464 page_id = page_n ,
6565 )
6666
6767 def __str__ (self ) -> str :
68- given_names = "\n " .join ([str (item ) for item in self .given_names ])
68+ given_names = f"\n { ' ' * 15 } " .join (
69+ [str (item ) for item in self .given_names ],
70+ )
6971 return clean_out_string (
70- "----- FR Carte Vitale V1 ----- \n "
71- f"Filename: { self . filename or '' } \n "
72- f"Given Name(s): { given_names } \n "
73- f"Surname: { self . surname } \n "
74- f"Social Security Number: { self .social_security } \n "
75- f"Issuance Date : { self .issuance_date } \n "
76- "---------------------- "
72+ "FR Carte Vitale V1 Prediction \n "
73+ "============================= \n "
74+ f":Filename: { self . filename or '' } \n "
75+ f":Given Name(s): { given_names } \n "
76+ f":Surname: { self .surname } \n "
77+ f":Social Security Number : { self .social_security } \n "
78+ f":Issuance Date: { self . issuance_date } \n "
7779 )
7880
7981
80- TypeCarteVitaleV1 = TypeVar ("TypeCarteVitaleV1" , bound = CarteVitaleV1 )
82+ TypeCarteVitaleV1 = TypeVar (
83+ "TypeCarteVitaleV1" ,
84+ bound = CarteVitaleV1 ,
85+ )
0 commit comments