Skip to content

WIP: PatientImport#process!#6746

Draft
chrisroos wants to merge 10 commits intonextfrom
patient-import-process
Draft

WIP: PatientImport#process!#6746
chrisroos wants to merge 10 commits intonextfrom
patient-import-process

Conversation

@chrisroos
Copy link
Copy Markdown
Contributor

This is an exploration into tidying up the PatientImport#process! method. It's not ready for review.

To make it clear that this creates a PatientChangeset.
I found it confusing that there was a local variable named `changesets`
and an ActiveRecord association named `changesets` (defined in both
`ClassImport` and `CohortImport`), and that this method was operating on
both. By removing this local variable we can be sure that this method is
always operating on the `changesets` association.
This was here to distinguish between the `changesets` local variable and
the association. Now that we're always operating on the association it's
no longer necessary.
I think the intention here is to _not_ queue up
`changesets.without_postcode` because they've already been queued up
earlier in the method.

If `changesets.with_postcode.any?` is truthy then this method would've
returned earlier, on line 72. The fact that we've reached this line
means that `changesets.with_postcode` will be empty so let's make that
explicit by returning an empty array.
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.

1 participant