Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #700 from Ferlab-Ste-Justine/fix/update-provider
Browse files Browse the repository at this point in the history
fix: CLIN-73 Update provider
  • Loading branch information
YanLabCHU authored Jun 17, 2021
2 parents 84df612 + 74fe3c3 commit f9b90a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions client/src/helpers/providers/extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,11 @@ export class DataExtractor {
}

public extractResource<T>(data: any, resourceType: ResourceType): T {
return data.entry.find((entry: any) => entry.resource.resourceType === resourceType).resource as T;
return data.entry?.find((entry: any) => entry.resource.resourceType === resourceType).resource as T;
}

public extractResources<T>(data: any, resourceType: ResourceType): T[] {
return data.entry
.filter((entry: any) => entry.resource.resourceType === resourceType)
return data.entry?.filter((entry: any) => entry.resource.resourceType === resourceType)
.map((entry: any) => entry.resource as T) as T[];
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/helpers/providers/patient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class PatientProvider extends Provider<Patient, ParsedPatientData> {
? bloodRelationshipExt.valueCoding.display
: 'N/A',
familyId: get(familyIdExt, 'valueReference.reference', '').split('/')[1],
familyType: group.type,
familyType: get(group, 'type', 'solo'),
proband: probandExt != null && probandExt.valueBoolean ? 'Proband' : 'Parent',
isFetus: fetusExt != null && fetusExt.valueBoolean,
familyRelation: familyRelationExt?.extension[0].valueReference.reference.split('/')[1],
Expand Down

0 comments on commit f9b90a6

Please sign in to comment.