Skip to content

[tools] CouchDB_Import_Demographics.php #9754

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/CouchDB_Import_Demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function _generateQuery()
$latestProjDx.Diagnosis AS $latestProjDx";
$tablesToJoin .= "
LEFT JOIN (
SELECT c.CandID, Diagnosis
SELECT c.ID as CandidateID, c.CandID, Diagnosis
FROM candidate_diagnosis_evolution_rel cde
JOIN diagnosis_evolution de USING (DxEvolutionID)
JOIN candidate c ON c.ID=cde.CandidateID
Expand All @@ -304,7 +304,7 @@ function _generateQuery()
WHERE de2.ProjectID=$projectID
GROUP BY CandID
) AS maxOrderNumber ON (
maxOrderNumber.CandidateID=cde.CandidateID
maxOrderNumber.CandID=cde.CandidateID
AND maxOrderNumber.OrderNumber=de.OrderNumber
)
WHERE ProjectID=$projectID
Expand Down Expand Up @@ -432,7 +432,7 @@ function run()
if ($config_setting->getSetting("useFamilyID") === "true") {
$familyID = $this->SQLDB->pselectOne(
"SELECT FamilyID FROM family
WHERE CandID=:cid",
WHERE CandidateID=:cid",
['cid' => $demographics['CandID']]
);
if (!empty($familyID)) {
Expand Down
Loading