Skip to content
Open
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
2 changes: 1 addition & 1 deletion Common-UI
Original file line number Diff line number Diff line change
Expand Up @@ -163,45 +163,31 @@ export class GeneralOpdHistoryComponent
}

loadFormData() {
this.pastHistory = this.nurseGeneralHistoryForm.get(
'pastHistory'
) as FormGroup;
this.comorbidityHistory = this.nurseGeneralHistoryForm.get(
'comorbidityHistory'
) as FormGroup;
this.medicationHistory = this.nurseGeneralHistoryForm.get(
'medicationHistory'
) as FormGroup;
this.personalHistory = this.nurseGeneralHistoryForm.get(
'personalHistory'
) as FormGroup;
this.familyHistory = this.nurseGeneralHistoryForm.get(
'familyHistory'
) as FormGroup;
this.menstrualHistory = this.nurseGeneralHistoryForm.get(
'menstrualHistory'
) as FormGroup;
this.perinatalHistory = this.nurseGeneralHistoryForm.get(
'perinatalHistory'
) as FormGroup;
this.pastObstericHistory = this.nurseGeneralHistoryForm.get(
'pastObstericHistory'
) as FormGroup;
this.immunizationHistory = this.nurseGeneralHistoryForm.get(
'immunizationHistory'
) as FormGroup;
this.otherVaccines = this.nurseGeneralHistoryForm.get(
'otherVaccines'
) as FormGroup;
this.feedingHistory = this.nurseGeneralHistoryForm.get(
'feedingHistory'
) as FormGroup;
this.developmentHistory = this.nurseGeneralHistoryForm.get(
'developmentHistory'
) as FormGroup;
this.physicalActivityHistory = this.nurseGeneralHistoryForm.get(
'physicalActivityHistory'
) as FormGroup;
const form = this.nurseGeneralHistoryForm;
if (!form) return;
const pick = (name: string): FormGroup | undefined => {
const ctrl = form.get(name);
return ctrl ? (ctrl as FormGroup) : undefined;
};
this.pastHistory = pick('pastHistory') ?? this.pastHistory;
this.comorbidityHistory =
pick('comorbidityHistory') ?? this.comorbidityHistory;
this.medicationHistory =
pick('medicationHistory') ?? this.medicationHistory;
this.personalHistory = pick('personalHistory') ?? this.personalHistory;
this.familyHistory = pick('familyHistory') ?? this.familyHistory;
this.menstrualHistory = pick('menstrualHistory') ?? this.menstrualHistory;
this.perinatalHistory = pick('perinatalHistory') ?? this.perinatalHistory;
this.pastObstericHistory =
pick('pastObstericHistory') ?? this.pastObstericHistory;
this.immunizationHistory =
pick('immunizationHistory') ?? this.immunizationHistory;
this.otherVaccines = pick('otherVaccines') ?? this.otherVaccines;
this.feedingHistory = pick('feedingHistory') ?? this.feedingHistory;
this.developmentHistory =
pick('developmentHistory') ?? this.developmentHistory;
this.physicalActivityHistory =
pick('physicalActivityHistory') ?? this.physicalActivityHistory;
}

ngOnChanges(changes: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,34 @@ export class PatientVisitDetailsComponent
this.beneficiaryDetailsSubscription.unsubscribe();
}

private readonly supportedVisitCategories = [
'General OPD (QC)',
'Cancer Screening',
'General OPD',
'NCD screening',
'PNC',
'ANC',
'NCD care',
'COVID-19 Screening',
];

private filterSupportedCategories(categories: any[]): any[] {
const age = this.beneficiary?.ageVal;
return (categories || []).filter((item: any) => {
const name = item?.visitCategory;
if (!this.supportedVisitCategories.includes(name)) return false;
if (
(name === 'NCD screening' || name === 'NCD care') &&
age !== null &&
age !== undefined &&
age < 30
) {
return false;
}
return true;
});
}

visitCategorySubscription: any;
getVisitReasonAndCategory() {
this.visitCategorySubscription =
Expand All @@ -127,8 +155,9 @@ export class PatientVisitDetailsComponent
this.templateNurseMasterData
);
this.templateVisitReasons = this.templateNurseMasterData.visitReasons;
this.templateVisitCategories =
this.templateNurseMasterData.visitCategories;
this.templateVisitCategories = this.filterSupportedCategories(
this.templateNurseMasterData.visitCategories
);
this.templateFilterVisitCategories = this.templateVisitCategories;

if (
Expand Down
13 changes: 9 additions & 4 deletions src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,15 @@ export class WorkareaComponent
this.referMode = new String(mode);
this.caseRecordMode = new String(mode);
}
} else {
setTimeout(() =>
this.confirmationService.alert(
this.currentLanguageSet?.alerts?.info
?.visitCategoryNotSupported ||
'This visit category is not supported. Please re-select the visit category.',
'info'
)
);
}
} else if (this.specialistFlag === '100') {
this.showOnlyTMReferred();
Expand Down Expand Up @@ -1060,10 +1069,6 @@ export class WorkareaComponent
this.showPNC = false;
this.showCaseRecord = false;
this.showRefer = false;

if (this.attendantType === 'nurse') {
this.changeDetectorRef.detectChanges();
}
}

submitPatientMedicalDetailsForm(medicalForm: any) {
Expand Down