-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix(migration): introduce conditionality and continue indexing on failure #7742
Merged
+47
−36
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c71656a
fix(migration): add conditionality to type error. Fetch location when…
makelicious 4cfe1c0
fix(migration): add conditionality checks for hearth migrations
makelicious 112bbaf
fix(migration): add missing conditional
makelicious f0738f0
fix(migration): add fallback onError for daysInYear date
makelicious 3f3c246
fix(migration): add fallback to dates
makelicious c44afb0
fix(migration): do not throw during onDrop event
makelicious fea0749
fix(migration): log out dropped ids after stream end
makelicious 70abbbc
fix(migration): clean up unneeded changes made during debugging
makelicious e5321e9
fix(migration): fetch location when id is found during population. Cl…
makelicious fd1b46a
fix(migration): add variable to clarify code
makelicious 13a2754
fix(migration): change logging level to error
makelicious File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -138,10 +138,11 @@ async function updateEventLocationIdOrJurisdictionIds(db: Db, elasticDoc: any) { | |||||
) | ||||||
|
||||||
if (encounterDoc.length > 0) { | ||||||
const locationId = encounterDoc[0].location[0].location.reference.replace( | ||||||
'Location/', | ||||||
'' | ||||||
) | ||||||
const locationId = | ||||||
encounterDoc[0]?.location?.[0]?.location?.reference?.replace( | ||||||
'Location/', | ||||||
'' | ||||||
) | ||||||
|
||||||
const locationDoc = await getCollectionDocuments( | ||||||
db, | ||||||
|
@@ -150,10 +151,10 @@ async function updateEventLocationIdOrJurisdictionIds(db: Db, elasticDoc: any) { | |||||
) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be similar to |
||||||
|
||||||
if (locationDoc.length > 0) { | ||||||
if (locationDoc[0].type.coding[0].code === 'HEALTH_FACILITY') { | ||||||
body.eventLocationId = locationDoc[0].id | ||||||
if (locationDoc?.[0]?.type?.coding?.[0]?.code === 'HEALTH_FACILITY') { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
as we just asserted that length is greater than zero 😄 |
||||||
body.eventLocationId = locationDoc[0]?.id | ||||||
} else { | ||||||
const address = locationDoc[0].address | ||||||
const address = locationDoc[0]?.address | ||||||
if (address) { | ||||||
const eventJurisdictionIds: string[] = [] | ||||||
address.state && eventJurisdictionIds.push(address.state) | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this is safer instead of the three lines here?