Skip to content

Commit

Permalink
RT-1327:(charts-on-fhir) Observation mapper creates multiple layers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpmohod authored May 24, 2024
1 parent 2e9d9a6 commit 6c6dc61
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/ngx-charts-on-fhir/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@elimuinformatics/ngx-charts-on-fhir",
"version": "3.4.5",
"version": "3.4.6",
"description": "Charts-on-FHIR: A data visualization library for SMART-on-FHIR healthcare applications",
"license": "Apache-2.0",
"homepage": "https://elimuinformatics.github.io/charts-on-fhir",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('ComponentObservationMapper', () => {
resourceType: 'Observation',
status: 'final',
code: { text: 'text' },
category: [{ coding: [{ display: 'A' }] }, { coding: [{ display: 'B' }] }],
category: [{ coding: [{ code: 'A' }] }, { coding: [{ code: 'B' }] }],
effectiveDateTime: new Date().toISOString(),
component: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ComponentObservationMapper implements Mapper<ComponentObservation>
const layerName = overrideLayerName ?? codeName;
return {
name: layerName,
category: resource.category?.flatMap((c) => c.coding?.map((coding) => coding.display)).filter(isDefined),
category: resource.category?.flatMap((c) => c.coding?.map((coding) => coding.code)).filter(isDefined),
datasets: resource.component.map((component) => ({
label: this.codeService.getName(component.code, resource) + getMeasurementSettingSuffix(resource),
yAxisID: layerName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('SimpleObservationMapper', () => {
resourceType: 'Observation',
status: 'final',
code: { text: 'text' },
category: [{ coding: [{ display: 'A' }] }, { coding: [{ display: 'B' }] }],
category: [{ coding: [{ code: 'A' }] }, { coding: [{ code: 'B' }] }],
effectiveDateTime: new Date().toISOString(),
valueQuantity: { value: 7, unit: 'unit' },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class SimpleObservationMapper implements Mapper<SimpleObservation> {
const layerName = overrideLayerName ?? codeName;
return {
name: layerName,
category: resource.category?.flatMap((c) => c.coding?.map((coding) => coding.display)).filter(isDefined),
category: resource.category?.flatMap((c) => c.coding?.map((coding) => coding.code)).filter(isDefined),
datasets: [
{
label: codeName + getMeasurementSettingSuffix(resource),
Expand Down

0 comments on commit 6c6dc61

Please sign in to comment.