Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drug measurement fields are mutually required #14

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

mint-thompson
Copy link
Collaborator

If either drug_unit_of_measurement or drug_type_of_measurement are not empty, then both fields are required.

If either drug_unit_of_measurement or drug_type_of_measurement are not
empty, then both fields are required.
t.is(emptyDrugTypeResult.length, 1)
t.assert(
emptyDrugTypeResult[0].message.includes(
'"drug_type_of_measurement" is required when "drug_unit_of_measurement" is present'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the inverse work too? If 'drug_unit_of_measurement' is required when 'drug_type_of_measurement' is present?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, there's a test for that up on line 187.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oof, apologies for my not RTFM!

@mint-thompson mint-thompson merged commit adac89e into main Feb 29, 2024
4 checks passed
@mint-thompson mint-thompson deleted the drug-measurement-bidirectional branch February 29, 2024 20:19
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.

2 participants