Skip to content

Commit

Permalink
Resolve CMO Patient ID from PatientAlias
Browse files Browse the repository at this point in the history
Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
  • Loading branch information
ao508 committed Sep 6, 2024
1 parent 845d7f2 commit 30a0fa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions graphql-server/src/utils/flattening.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ const nestedValueGetters: NestedValueGetters = {
Patient: (parent, fieldName, _context) => {
switch (fieldName) {
case "cmoPatientId":
return parent.hasSampleSamples?.[0]?.hasMetadataSampleMetadata?.[0]
?.cmoPatientId;
return parent.patientAliasesIsAlias?.find(
(patientAlias) => patientAlias.namespace === "cmoId"
)?.value;
case "dmpPatientId":
return parent.patientAliasesIsAlias?.find(
(patientAlias) => patientAlias.namespace === "dmpId"
Expand Down

0 comments on commit 30a0fa3

Please sign in to comment.