Open kmubiin opened 7 years ago
I have locally resolved item 3, but no commits yet. I will push the changes as several commits (instead of single commit) so that the changes can be observed in stages and ease of review.
This commit a24bc29 has simplified the code. Both item 2 and item 3 (one project and multiple projects) are now handled by same case of if-statement.
At this point, the only award data that is not converted to OCDS-CIDB data is the "location" field and its value. There are two ways to handle this leftout information:
Put the value to "description" under "award" field. This will pass in the validation result.
Simply add "location" and its value to JSON. This however, will cause this added field to appear under "Additional Fields (fields in data not in schema)" in the validation result.
If the "location" information is not needed, then this issue can be closed.
As the conversion script was written in hurry, I didn't bother to check the data consistency between CIDB data and OCDS-CIDB data until now. So self-reporting this as the first issue.
The "projects" list from CIDB data is being parsed into "award" field, which will hold the value of list. Note that the "projects" list may have:
Item 1 was resolved by considering if the list was empty, set
awards_data
to "None". Item 2 is resolved by parsing as it is to the functionocds_awards()
and pointing to the first object in the list by index[0]
.However, item 3 was overlooked and is not considered at the moment.