Skip to content

Commit

Permalink
fix(migration): clean up unneeded changes made during debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
makelicious committed Oct 8, 2024
1 parent fea0749 commit 70abbbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const up = async (db: Db, client: MongoClient) => {
const compositionDoc =
(await compositionCursor.next()) as unknown as fhir.Composition

await setInformantDeceasedAndLocationDetails(db, body, compositionDoc) // <-- this one throws the error
await setInformantDeceasedAndLocationDetails(db, body, compositionDoc)
}
skip += limit
processedDocCount += count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,16 +452,10 @@ export const up = async (db: Db, client: MongoClient) => {
districtName: '$district.name',
stateName: '$state.name',
createdAt: {
$dateFromString: {
dateString: '$firstTask.lastModified',
onError: new Date(0).toISOString()
}
$dateFromString: { dateString: '$firstTask.lastModified' }
},
registeredAt: {
$dateFromString: {
dateString: '$registerTask.lastModified',
onError: new Date(0).toISOString()
}
$dateFromString: { dateString: '$registerTask.lastModified' }
},
status: '$latestTask.businessStatus.coding.code',
childsAgeInDaysAtDeclaration: 1,
Expand Down Expand Up @@ -637,10 +631,7 @@ export const up = async (db: Db, client: MongoClient) => {
stateName: '$state.name',
event: 'Birth',
createdAt: {
$dateFromString: {
dateString: '$lastModified',
onError: new Date(0).toISOString()
}
$dateFromString: { dateString: '$lastModified' }
}
}
},
Expand Down Expand Up @@ -776,7 +767,7 @@ export const up = async (db: Db, client: MongoClient) => {
_id: { $concat: [{ $toString: '$id' }, '_', '$daysInYear.date'] },
name: 1,
date: {
$dateFromString: { dateString: '$daysInYear.date', onError: null }
$dateFromString: { dateString: '$daysInYear.date' }
},
estimatedNumberOfBirths: '$daysInYear.estimatedNumberOfBirths',
event: 'Birth'
Expand Down

0 comments on commit 70abbbc

Please sign in to comment.