Skip to content

VED-1088-Validate-system-URL-in-patient-identifier-resource#1272

Open
amarauzoma wants to merge 2 commits intomasterfrom
VED-1088-Validate-system-URL-in-patient-identifier-resource
Open

VED-1088-Validate-system-URL-in-patient-identifier-resource#1272
amarauzoma wants to merge 2 commits intomasterfrom
VED-1088-Validate-system-URL-in-patient-identifier-resource

Conversation

@amarauzoma
Copy link
Contributor

  • Routine Change
  • ❗ Breaking Change
  • 🤖 Operational or Infrastructure Change
  • ✨ New Feature
  • ⚠️ Potential issues that might be caused by this change

Add any other relevant notes or explanations here. Remove this line if you have nothing to add.

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 of the acceptance criteria of the ticket.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • If there were changes that are outside of the regular release processes e.g. account infrastructure to setup, manual setup for external API integrations, secrets to set, then I have checked that the developer has flagged this to the Tech Lead as release steps.
  • I have checked that no Personal Identifiable Data (PID) is logged as part of the changes.

legacy CSV field name: NHS_NUMBER) exists, then it is 'https://fhir.nhs.uk/Id/nhs-number'
"""
field_location = "contained[?(@.resourceType=='Patient')].identifier[0].system"
predefined_values = [Urls.NHS_NUMBER]
Copy link
Contributor

Choose a reason for hiding this comment

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

Pre‑validators still enforce that any Patient identifier if present must use the NHS number.

"value"
]
PreValidation.for_string(field_value, field_location, defined_length=10, spaces_allowed=False)
PreValidation.for_nhs_number(field_value, field_location)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

create_result = CustomValidationError(
message="Validation errors: contained[?(@.resourceType=='Patient')].identifier[0].value does not exists"
message="Validation errors: contained[?(@.resourceType=='Patient')].identifier[?(@.system=='https://fhir.nhs.uk/Id/nhs-number')].value does not exists"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be better to put this in a function, so its use is clear and it can be re-used?

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