@@ -67,16 +67,15 @@ def from_notice_metadata(cls, notice_metadata: ExtractedMetadata) -> PackagerMet
6767 metadata .notice .id = cls .normalize_value (notice_metadata .notice_publication_number )
6868
6969 # WORK
70+ publication_date = datetime .datetime .strptime (notice_metadata .publication_date , '%Y%m%d' ).strftime ('%Y-%m-%d' )
7071 metadata .work .identifier = publication_work_identifier (metadata .notice .id , notice_metadata )
7172 metadata .work .cdm_rdf_type = PROCUREMENT_PUBLIC
7273 metadata .work .resource_type = PROCUREMENT_NOTICE
73- metadata .work .date_document = notice_metadata . publication_date
74- metadata .work .uri = publication_notice_uri (metadata .notice .id )
74+ metadata .work .date_document = publication_date
75+ metadata .work .uri = publication_notice_uri (metadata .notice .id , notice_metadata )
7576 title_search = [t .title .text for t in notice_metadata .title if t .title .language == LANGUAGE .upper ()]
7677 if len (title_search ) > 0 :
7778 metadata .work .title = {LANGUAGE : title_search [0 ]}
78- metadata .work .date_creation = datetime .datetime \
79- .strptime (notice_metadata .publication_date , '%Y%m%d' ).strftime ('%Y-%m-%d' )
8079 metadata .work .dataset_version = _date .strftime ('%Y%m%d' ) + '-' + _revision
8180 metadata .work .procurement_public_issued_by_country = notice_metadata .country_of_buyer
8281 metadata .work .procurement_public_url_etendering = notice_metadata .uri_list
@@ -85,23 +84,23 @@ def from_notice_metadata(cls, notice_metadata: ExtractedMetadata) -> PackagerMet
8584 metadata .expression .title = {LANGUAGE : BASE_TITLE + " " + metadata .notice .id }
8685
8786 # MANIFESTATION
88- metadata .manifestation .date_publication = notice_metadata . publication_date
87+ metadata .manifestation .date_publication = publication_date
8988 return metadata
9089
9190
92- def publication_notice_year (notice_id ):
93- return notice_id . split ( NORMALIZED_SEPARATOR )[ 1 ]
91+ def publication_notice_year (notice_metadata ):
92+ return datetime . datetime . strptime ( notice_metadata . publication_date , '%Y%m%d' ). strftime ( '%Y' )
9493
9594
9695def publication_notice_number (notice_id ):
9796 return notice_id .split (NORMALIZED_SEPARATOR )[0 ]
9897
9998
100- def publication_notice_uri (notice_id ):
101- return f"{ BASE_WORK } { publication_notice_year (notice_id )} /{ notice_id } "
99+ def publication_notice_uri (notice_id , notice_metadata ):
100+ return f"{ BASE_WORK } { publication_notice_year (notice_metadata )} /{ notice_id } "
102101
103102
104103def publication_work_identifier (notice_id , notice_metadata ):
105- year = publication_notice_year (notice_id )
104+ year = publication_notice_year (notice_metadata )
106105 number = publication_notice_number (notice_id )
107106 return f"{ year } _{ notice_metadata .ojs_type } _{ notice_metadata .ojs_issue_number } _{ number } "
0 commit comments