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

IHE gateway V2: Zod Validation and Typing Responses #2032

Merged
merged 13 commits into from
Jun 14, 2024

Conversation

jonahkaye
Copy link
Member

@jonahkaye jonahkaye commented May 7, 2024

Ticket: #1667

Dependencies

Description

  • zod validation of inbound iti responses and adding typing throughout processing

Testing

  • Local
    • unit tests
    • local flow
  • Staging
    • tested to staging

Release Plan

  • Merge this

@jonahkaye jonahkaye changed the title feat(ihev2): dq schema IHE gateway V2: Zod Validation and Typing Responses May 7, 2024
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Copy link
Member Author

Choose a reason for hiding this comment

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

remove this

Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
@jonahkaye jonahkaye force-pushed the 1667-zod-validation-iti-response-refactor branch 2 times, most recently from f5ffc2e to fb98d4e Compare June 5, 2024 19:25
<name>
<family partType="FAM">NWHINZZZTESTPATIENT</family>
<given partType="GIV">NWHINONE</given>
</name>
Copy link
Member Author

Choose a reason for hiding this comment

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

adding test for where name is in different format which we saw in prod

Copy link
Member Author

Choose a reason for hiding this comment

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

shared schemas


const findSlotValue = (name: string): string | undefined => {
const slot = slots.find((slot: Slot) => slot._name === name);
return slot
? Array.isArray(slot.ValueList.Value)
Copy link
Member Author

Choose a reason for hiding this comment

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

ValueList.Value is never an array so removing this

Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
@jonahkaye jonahkaye force-pushed the 1667-zod-validation-iti-response-refactor branch from 1085759 to e939ec7 Compare June 5, 2024 19:46
@jonahkaye jonahkaye self-assigned this Jun 5, 2024
@jonahkaye jonahkaye marked this pull request as ready for review June 5, 2024 19:48
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Copy link
Contributor

@RamilGaripov RamilGaripov left a comment

Choose a reason for hiding this comment

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

Approved on the condition that my comments are addressed

Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
@jonahkaye jonahkaye force-pushed the 1667-zod-validation-iti-response-refactor branch from d03bba8 to 6ad9752 Compare June 11, 2024 00:14
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Copy link
Member

@leite08 leite08 left a comment

Choose a reason for hiding this comment

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

  • handleSchemaErrorResponse(): I see we're not logging or doing anything w/ the information that we had a schema parsing error - shouldn't we?

Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Copy link
Member

@leite08 leite08 left a comment

Choose a reason for hiding this comment

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

Leaving a few comments.

Missed this one:

handleSchemaErrorResponse(): I see we're not logging or doing anything w/ the information that we had a schema parsing error - shouldn't we?

@jonahkaye
Copy link
Member Author

Leaving a few comments.

Missed this one:

handleSchemaErrorResponse(): I see we're not logging or doing anything w/ the information that we had a schema parsing error - shouldn't we?

4899def addressed in this commit

@jonahkaye jonahkaye force-pushed the 1667-zod-validation-iti-response-refactor branch 2 times, most recently from 4899def to f6e1578 Compare June 14, 2024 02:48
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Refs: #1667
Signed-off-by: Jonah Kaye <jonah.arturo@gmail.com>
Copy link
Member

@leite08 leite08 left a comment

Choose a reason for hiding this comment

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

LGTM, approving considering we can address the couple of small comments. 🚀

@jonahkaye jonahkaye added this pull request to the merge queue Jun 14, 2024
Merged via the queue into develop with commit bb9e532 Jun 14, 2024
13 checks passed
@jonahkaye jonahkaye deleted the 1667-zod-validation-iti-response-refactor branch June 14, 2024 13:58
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.

3 participants