Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC-900: Unable to post lab for children <2yrs who have sero converte… #1778

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ jobs:
- name: Build prod
run: npm run build-prod
- name: Upload build files to artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: build-files
name: build-files-${{ github.run_id }}
path: dist
retention-days: 7
# - name: Run headless tests
# uses: GabrielBB/xvfb-action@v1
# with:
Expand Down
14 changes: 12 additions & 2 deletions src/app/lab-order-search/lab-order-search-post.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.patientIdentifers = identifiers;
});
this.patient = this.order.patient;

this.person = new Person(this.order.patient.person);
if (
Moment().diff(Moment(this.person.birthdate), 'months') <= 18 &&
Expand All @@ -148,7 +147,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.cccIdentifierType
)
) {
this.isHEIActive = true;
this.isHEIActive = this.hasCCCNumber(this.patient) ? false : true;
} else {
this.isHEIActive = false;
}
Expand All @@ -166,6 +165,17 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.setDefaultLocation();
}

public hasCCCNumber(patient: any): boolean {
const CCC_IDENTIFIER_UUID = 'f2d6ff1a-8440-4d35-a150-1d4b5a930c5e';

return patient && patient.identifiers
? patient.identifiers.some(
(id: any) =>
id.identifierType && id.identifierType.uuid === CCC_IDENTIFIER_UUID
)
: false;
}

public displayPregnancy() {
const pmtctCategory = this.findObs(
this.order.encounter.obs,
Expand Down
Loading