Skip to content

Commit

Permalink
Add fax to contact points (#2863)
Browse files Browse the repository at this point in the history
* fix: move things to fhir converter, unify make and docker

* ci: remove dotnet testing

* fix: undo debugging docker changes

* fix: more debugging clenaup

* docs: update README with current dev guidance and pointing to the fork

* feat: allow passing the converter tool path as an environment variable

* fix: rename environment variable

* test: make sure fax gets converted

* fix: pipe through the fax number to the viewer

* test: add unit test

* add colon separator

* Update containers/fhir-converter/Dockerfile

* build: use correct tag
  • Loading branch information
mcmcgrath13 authored Nov 7, 2024
1 parent 7de7adc commit 7d7d27e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
7 changes: 7 additions & 0 deletions containers/ecr-viewer/src/app/services/formatService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,13 @@ export const formatContactPoint = (
);
} else if (contactPoint.system === "email" && contactPoint.value) {
contactArr.push(contactPoint.value);
} else if (contactPoint.system === "fax" && contactPoint.value) {
const faxNumberUse = toSentenceCase(contactPoint.use ?? "");
contactArr.push(
[faxNumberUse, "Fax:", formatPhoneNumber(contactPoint.value ?? "")]
.join(" ")
.trim(),
);
}
}
return contactArr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,21 @@ describe("formatContactPoint", () => {
const actual = formatContactPoint(contactPoints);
expect(actual).toEqual(["me@example.com", "medicine@example.com"]);
});
it("should return fax information ", () => {
const contactPoints: ContactPoint[] = [
{
system: "fax",
value: "+13135551234",
use: "work",
},
{
system: "fax",
value: "+1 313 555-1235",
},
];
const actual = formatContactPoint(contactPoints);
expect(actual).toEqual(["Work Fax: 313-555-1234", "Fax: 313-555-1235"]);
});
});

describe("formatPhoneNumber", () => {
Expand Down
2 changes: 1 addition & 1 deletion containers/fhir-converter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build

# Download FHIR-Converter
RUN git clone https://github.com/skylight-hq/FHIR-Converter.git --branch v7.0-skylight-4 --single-branch /build/FHIR-Converter
RUN git clone https://github.com/skylight-hq/FHIR-Converter.git --branch v7.0-skylight-5 --single-branch /build/FHIR-Converter

WORKDIR /build/FHIR-Converter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,11 @@
'use': 'work',
'value': '(661)382-5000',
}),
dict({
'system': 'fax',
'use': 'work',
'value': '(661)382-5001',
}),
]),
}),
}),
Expand Down

Large diffs are not rendered by default.

0 comments on commit 7d7d27e

Please sign in to comment.