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

Mch #1747

Closed
wants to merge 3 commits into from
Closed

Mch #1747

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/build-version/build-version.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { VERSION } from '../../environments/version';
})
export class BuildVersionComponent implements OnInit {
public version: string;
public buildDate: Date;
public buildDate: any;
public hash: string;
constructor() {}

Expand All @@ -20,7 +20,7 @@ export class BuildVersionComponent implements OnInit {
try {
this.version = VERSION.version;
this.hash = VERSION.hash;
this.buildDate = new Date(VERSION.buildDate);
this.buildDate = 'Feb 15, 2024, 6:38:55 PM'; // new Date(VERSION.buildDate);
} catch (e) {}
}
}
16 changes: 15 additions & 1 deletion src/app/constants/program.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ const PMTCT_PROGRAM: Program = {
dept: 'HIV',
compatibleWithOtherDeptPrograms: false
};
const ANC_PROGRAM: Program = {
uuid: '52aeb285-fb18-455b-893e-3e53ccc77ceb',
name: 'ANTENATAL CARE PROGRAM',
dept: 'HIV',
compatibleWithOtherDeptPrograms: false
};
const PNC_PROGRAM: Program = {
uuid: 'd2552058-d7bd-47c6-aed1-480a4308027a',
name: 'POSTNATAL PROGRAM',
dept: 'HIV',
compatibleWithOtherDeptPrograms: false
};
const STANDARD_HIV_PROGRAM: Program = {
uuid: '781d85b0-1359-11df-a1f1-0026b9348838',
name: 'STANDARD HIV TREATMENT',
Expand Down Expand Up @@ -122,5 +134,7 @@ export const Programs = {
EXPRESS_CARE_PROGRAM,
DTG_PHARMACO_VIGILANCE_PROGRAM,
HIV_SOCIAL_WORK_PROGRAM,
NUTRITION_PROGRAM
NUTRITION_PROGRAM,
ANC_PROGRAM,
PNC_PROGRAM
};
6 changes: 5 additions & 1 deletion src/app/constants/referral-concepts.contants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const PPP_REFERRAL_CONCEPT = '4e6d1c61-624c-4350-a604-374f835aa481';
const PATIENT_PREFERENCE_CONCEPT = '7e7d4555-362a-498a-b5ed-abcddcfce2a7';
const STANDARD_HIV_CARE_REFERRAL_CONCEPT =
'b412ae76-4ab4-4d00-800e-bd8d167769e1';
const ANC_CONCEPT = '375e6d4a-ba94-41ac-8ac3-5a56015c4d92';
const PNC_CONCEPT = 'c5789e91-2c76-450a-94f7-94fce32335d3';

export const ReferralConcepts = {
differentiatedCareConceptUuid,
Expand All @@ -27,5 +29,7 @@ export const ReferralConcepts = {
BACK_TO_CCC_REFERRAL_CONCEPT,
PPP_REFERRAL_CONCEPT,
PATIENT_PREFERENCE_CONCEPT,
STANDARD_HIV_CARE_REFERRAL_CONCEPT
STANDARD_HIV_CARE_REFERRAL_CONCEPT,
ANC_CONCEPT,
PNC_CONCEPT
};
1 change: 1 addition & 0 deletions src/app/interfaces/return-value.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface ReturnValue {
providerUuid: string;
locationUuid: string;
hivReferralLocationUuid: string;
pmtctProgrammeUuid: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import { FormUuids } from './../../../constants/forms.constants';

@Injectable()
export class FormentryReferralsHandlerService {
private PMTCT_PROGRAM: Program = Programs.PMTCT_PROGRAM;
private PNC_PROGRAM: Program = Programs.PNC_PROGRAM;
private ANC_PROGRAM: Program = Programs.ANC_PROGRAM;
private STANDARD_PROGRAM: Program = Programs.STANDARD_HIV_PROGRAM;

constructor(
Expand Down Expand Up @@ -217,7 +218,8 @@ export class FormentryReferralsHandlerService {
encounterDatetime: null,
providerUuid: '',
locationUuid: '',
hivReferralLocationUuid: ''
hivReferralLocationUuid: '',
pmtctProgrammeUuid: ''
};

const formUuid = form.schema.uuid ? form.schema.uuid : '';
Expand All @@ -226,6 +228,7 @@ export class FormentryReferralsHandlerService {
const referrals_1 = this.getQuestionValue(form, 'referrals');
const internalMvmentData = this.getQuestionValue(form, 'careType');
const interMovementQstnAns = this.getQuestionValue(form, 'internalMove');

// validating if selected option is DC care and referrals is blank. Adult and youth forms are different
const referrals =
referrals_1 === undefined
Expand Down Expand Up @@ -257,6 +260,8 @@ export class FormentryReferralsHandlerService {
// haS PMTCT referral
if (internalMvmentData === ReferralConcepts.MCH_PROGRAM_CONCEPT) {
returnValue.hasPmtctReferral = true;
const pmtctPatientType = this.getQuestionValue(form, 'pmtctType');
returnValue.pmtctProgrammeUuid = pmtctPatientType;
}

// has ACTG referral
Expand Down Expand Up @@ -319,8 +324,15 @@ export class FormentryReferralsHandlerService {
referralMetaData: referralObj
};
if (referralObj.hasPmtctReferral) {
refProgram.uuid = this.PMTCT_PROGRAM.uuid;
refProgram.name = this.PMTCT_PROGRAM.name;
if (referralObj.pmtctProgrammeUuid === ReferralConcepts.ANC_CONCEPT) {
refProgram.uuid = this.ANC_PROGRAM.uuid;
refProgram.name = this.ANC_PROGRAM.name;
} else if (
referralObj.pmtctProgrammeUuid === ReferralConcepts.PNC_CONCEPT
) {
refProgram.uuid = this.PNC_PROGRAM.uuid;
refProgram.name = this.PNC_PROGRAM.name;
}
} else {
refProgram.uuid = this.STANDARD_PROGRAM.uuid;
refProgram.name = this.STANDARD_PROGRAM.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,13 @@ export class HivReferralComponent implements OnInit, OnChanges, OnDestroy {
const enrollmentsPayload = hivPrograms.map(
(hivProgram: ProgramEnrollment) => {
if (
hivProgram.program.uuid === Programs.STANDARD_HIV_PROGRAM.uuid &&
this.referredHivProgram.uuid === Programs.PMTCT_PROGRAM.uuid
) {
} else if (
hivProgram.program.uuid === Programs.PMTCT_PROGRAM.uuid &&
this.referredHivProgram.uuid === Programs.STANDARD_HIV_PROGRAM.uuid
) {
referredToStandard = true;
} else if (
this.referredHivProgram.uuid === Programs.PNC_PROGRAM.uuid ||
this.referredHivProgram.uuid === Programs.ANC_PROGRAM.uuid
) {
} else {
return {
location: this.referredHivProgram.locationUuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ export class HivReferralService {
let autoEnrollmentUuid = '';
if (programUuid === Programs.STANDARD_HIV_PROGRAM.uuid) {
autoEnrollmentUuid = this.STANDARD_HIV_AUTO_ENROLLMENT_ENCOUNTER;
} else if (programUuid === Programs.PMTCT_PROGRAM.uuid) {
} else if (
programUuid === Programs.ANC_PROGRAM.uuid ||
programUuid === Programs.PNC_PROGRAM.uuid
) {
autoEnrollmentUuid = this.PMTCT_AUTO_ENROLLMENT_ENCOUNTER;
}
return autoEnrollmentUuid;
Expand Down
Loading