Skip to content

Commit

Permalink
Merge branch 'main' into boban/2873-env-variables-next-runtime-env
Browse files Browse the repository at this point in the history
  • Loading branch information
BobanL committed Dec 13, 2024
2 parents 6da57fa + 1e129ae commit 837e55e
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 42 deletions.
75 changes: 40 additions & 35 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
comment:
layout: "diff, flags, files"
behavior: default
layout: "condensed_header, condensed_files, condensed_footer"
hide_project_coverage: true
coverage:
range: 80...100
status:
project:
default:
target: 80%
threshold: 10%
target: auto # auto means better than the last non-failing build
patch:
default:
target: 95%
threshold: 10%
flags:
- sdk
flags:
ecr-viewer:
paths:
- "containers/ecr-viewer"
fhir-converter:
paths:
- "containers/fhir-converter"
ingestion:
paths:
- "containers/ingestion"
message-parser:
paths:
- "containers/message-parser"
message-refiner:
paths:
- "containers/message-refiner"
orchestration:
paths:
- "containers/orchestration"
record-linkage:
paths:
- "containers/record-linkage"
trigger-code-reference:
paths:
- "containers/trigger-code-reference"
validation:
paths:
- "containers/validation"
flag_management:
default_rules:
carryforward: true
statuses:
- type: project
target: auto
- patch: 95%
individual_flags:
- name: ecr-viewer
paths:
- "containers/ecr-viewer"
statuses:
- type
- name: fhir-converter
paths:
- "containers/fhir-converter"
- name: ingestion
paths:
- "containers/ingestion"
- name: "message-parser"
paths:
- "containers/message-parser"
- name: "message-refiner"
paths:
- "containers/message-refiner"
- name: "orchestration"
paths:
- "containers/orchestration"
- name: "record-linkage"
paths:
- "containers/record-linkage"
- name: "trigger-code-reference"
paths:
- "containers/trigger-code-reference"
- name: "validation"
paths:
- "containers/validation"
10 changes: 8 additions & 2 deletions .github/workflows/container-ecr-viewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ jobs:
with:
node-version: ${{env.NODE_VERSION}}
- name: Install dependencies
working-directory: ./containers/${{env.CONTAINER}} # Navigate to your Node.js app directory
working-directory: ./containers/${{env.CONTAINER}}
run: npm install
- name: Run tests
working-directory: ./containers/${{env.CONTAINER}} # Navigate to your Node.js app directory
working-directory: ./containers/${{env.CONTAINER}}
run: npm test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ env.CONTAINER }}
cypress-e2e-tests:
if: false
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ tsconfig.tsbuildinfo

## Make local config file
/containers/local-config.env

# Code coverage
**/coverage/
1 change: 1 addition & 0 deletions containers/ecr-viewer/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const customJestConfig = {
"^mssql$": "<rootDir>/src/app/tests/__mocks__/mssql.js",
"^tedious$": "<rootDir>/src/app/tests/__mocks__/mssql.js",
},
collectCoverage: true,
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,15 @@ export const evaluateEmergencyContact = (
.map((contact) => {
const relationship = contact.relationship?.[0].coding?.[0]?.display;

const address = formatAddress(contact.address);
const contactName = contact.name ? formatName(contact.name) : "";

const address = contact.address ? formatAddress(contact.address) : "";

const phoneNumbers = formatContactPoint(contact.telecom);

return [relationship, address, phoneNumbers].filter(Boolean).join("\n");
return [relationship, contactName, address, phoneNumbers]
.filter(Boolean)
.join("\n");
})
.join("\n\n");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ describe("Evaluate Emergency Contact", () => {
use: "home",
},
],
name: {
given: ["Anastasia", "Bubbletea"],
family: "Pizza",
},
address: {
use: "home",
line: ["999 Single Court"],
Expand All @@ -312,7 +316,7 @@ describe("Evaluate Emergency Contact", () => {
mappings,
);
expect(actual).toEqual(
`sister\n999 Single Court\nBEVERLY HILLS, CA\n90210, USA\nHome: 615-995-9999`,
`sister\nAnastasia Bubbletea Pizza\n999 Single Court\nBEVERLY HILLS, CA\n90210, USA\nHome: 615-995-9999`,
);
});
it("should return multiple emergency contacts", () => {
Expand Down Expand Up @@ -343,6 +347,10 @@ describe("Evaluate Emergency Contact", () => {
use: "home",
},
],
name: {
given: ["Anastasia", "Bubbletea"],
family: "Pizza",
},
address: {
use: "home",
line: ["999 Single Court"],
Expand All @@ -363,6 +371,10 @@ describe("Evaluate Emergency Contact", () => {
],
},
],
name: {
given: ["Alberto", "Bonanza", "Bartholomew"],
family: "Eggbert",
},
telecom: [
{
system: "phone",
Expand All @@ -382,7 +394,7 @@ describe("Evaluate Emergency Contact", () => {
mappings,
);
expect(actual).toEqual(
`sister\n999 Single Court\nBEVERLY HILLS, CA\n90210, USA\nHome: 615-995-9999\n\nbrother\nHome: 615-995-1000\nHome Fax: 615-995-1001`,
`sister\nAnastasia Bubbletea Pizza\n999 Single Court\nBEVERLY HILLS, CA\n90210, USA\nHome: 615-995-9999\n\nbrother\nAlberto Bonanza Bartholomew Eggbert\nHome: 615-995-1000\nHome Fax: 615-995-1001`,
);
});
it("should not return empty space when address is not available in", () => {
Expand All @@ -406,6 +418,10 @@ describe("Evaluate Emergency Contact", () => {
],
},
],
name: {
given: ["Anastasia", "Bubbletea"],
family: "Pizza",
},
telecom: [
{
system: "phone",
Expand All @@ -419,7 +435,9 @@ describe("Evaluate Emergency Contact", () => {
BundleWithPatientAndContact,
mappings,
);
expect(actual).toEqual(`sister\nHome: 615-995-9999`);
expect(actual).toEqual(
`sister\nAnastasia Bubbletea Pizza\nHome: 615-995-9999`,
);
});
it("should return undefined if a patient has no contact", () => {
const actual = evaluateEmergencyContact(
Expand Down

0 comments on commit 837e55e

Please sign in to comment.