Skip to content

VED-227- FHIR-FLAT-JSON#396

Merged
Akol125 merged 9 commits intomasterfrom
VED-227-FHIR-FLAT-JSON
Apr 29, 2025
Merged

VED-227- FHIR-FLAT-JSON#396
Akol125 merged 9 commits intomasterfrom
VED-227-FHIR-FLAT-JSON

Conversation

@Akol125
Copy link
Contributor

@Akol125 Akol125 commented Apr 25, 2025

Summary

  • ❗ Breaking Change
  • EXPIRY_DATE, PERSON_DOB, and RECORDED_DATE fields are now strictly formatted as YYYYMMDD
  • Milliseconds are removed upfront from date-time fields before parsing.
  • Refactored unit tests for better error handling and validation

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Review Checklist

ℹ️ This section is to be filled in by the reviewer.

  • I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • I have ensured the changelog has been updated by the submitter, if necessary.

@Akol125 Akol125 changed the title Ved 227 fhir flat json VED-227- FHIR-FLAT-JSON Apr 25, 2025
@NHSDigital NHSDigital deleted a comment from sonarqubecloud bot Apr 25, 2025
Copy link
Contributor

@nhsdevws nhsdevws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put future date back in the tests.

nhsdevws
nhsdevws previously approved these changes Apr 25, 2025
robertnovac1
robertnovac1 previously approved these changes Apr 25, 2025
today_utc = datetime.now(ZoneInfo("UTC")).date()
if dt.date() > today_utc:
# 2. Use Expression Rule Format to parse the date, remove dashes and slashes
if expressionRule == "%Y%m%d":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As below, it seems odd that we only handle YYYYMMDD, YYYY-MM-DD or YYYY-MM-DDT... here. Why not just parse any valid ISO formatted date / datetime? Will check with Paul

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g. what about partial dates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorted


# Not Empty Validate - Returns exactly what is in the extracted fields no parsing or logic needed
def _convertToNotEmpty(self, expressionRule, fieldName, fieldValue, summarise, report_unexpected_exception):
if not fieldValue:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been added? Maybe I'm missing the point of NOTEMPTY, but I'd expect None to be an error (which would already be picked up by the logic below)

Copy link
Contributor Author

@Akol125 Akol125 Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was kinda thinking that if its empty the overall data from other data sources is also empty this means its an empty data, hence not exactly an error. what would you suggest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might just be a naming issue - convertToNotEmpty makes me think it will never return an empty string, but I might be wrong. Will check with Paul what his intention was. Don't think this is a blocker for getting this MR merged

@Akol125 Akol125 dismissed stale reviews from robertnovac1 and nhsdevws via f7c9fdd April 28, 2025 11:29
@sonarqubecloud
Copy link

@Akol125 Akol125 merged commit 51d6be7 into master Apr 29, 2025
8 checks passed
@dlzhry2nhs dlzhry2nhs deleted the VED-227-FHIR-FLAT-JSON branch February 21, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants