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-698: OTZ #1739

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@
"prestart": "node version.js",
"prettier:check": "prettier --check src/app"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,json,css,md,ts}": [
"prettier --write",
"ng lint ngx-amrs"
]
},


"private": true,
"dependencies": {
"@ampath-kenya/ngx-openmrs-formentry": "2.12.23",
Expand Down
50 changes: 50 additions & 0 deletions src/app/clinic-dashboard/hiv/hiv-program.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ import { Covid19ReportPatientListComponent } from './../../hiv-care-lib/covid-19
import { PreAppointmentOutreachComponent } from '../general/pre-appointment-outreach/pre-appointment-outreach.component';
import { PlhivNcdV2ReportPatientListComponent } from 'src/app/hiv-care-lib/plhiv-ncd-v2-report/plhiv-ncd-v2-report-patient-list/plhiv-ncd-v2-report-patient-list.component';
import { PlhivNcdV2ReportComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report.component';
import { RegistersDashboardComponent } from 'src/app/hiv-care-lib/registers/registers-dashboard.component';
import { OtzRegisterComponent } from 'src/app/hiv-care-lib/registers/otz/otz-registers/otz-register.component';

const routes: Routes = [
{
Expand Down Expand Up @@ -293,6 +295,41 @@ const routes: Routes = [
}
]
},
{
path: 'registers',
children: [
{
path: '',
component: MonthlyReportComponent
},
{
path: 'prep-report',
children: [
{
path: '',
component: PrepReportComponent
},
{
path: 'patient-list',
component: PrepReportPatientListComponent
}
]
},
{
path: 'patient-gains-and-loses',
children: [
{
path: '',
component: ClinicDashboardGainsAndLossesComponent
},
{
path: 'patient-list',
component: PatientGainsAndLosesPatientListComponent
}
]
}
]
},
{
path: 'hei-report',
children: [
Expand Down Expand Up @@ -505,6 +542,19 @@ const routes: Routes = [
}
]
},
{
path: 'registers',
children: [
{
path: '',
component: RegistersDashboardComponent
},
{
path: 'otz-register',
component: OtzRegisterComponent
}
]
},
{
path: 'hei-report',
children: [
Expand Down
5 changes: 3 additions & 2 deletions src/app/etl-api/etl-api.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { MOH412ResourceService } from './moh-412-resource.service';
import { ClinicFlowResourceService } from './clinic-flow-resource.service';
import { Covid19ResourceService } from './covid-19-resource-service';
import { LocationUnitsService } from './location-units.service';

import { OtzRegisterService } from './otz-register.service';
@NgModule({
imports: [CommonModule, AppSettingsModule],
declarations: [],
Expand Down Expand Up @@ -93,7 +93,8 @@ import { LocationUnitsService } from './location-units.service';
MOH412ResourceService,
ClinicFlowResourceService,
Covid19ResourceService,
LocationUnitsService
LocationUnitsService,
OtzRegisterService
],
exports: []
})
Expand Down
65 changes: 65 additions & 0 deletions src/app/etl-api/otz-register-resource.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';

import { Observable, of } from 'rxjs';
import * as _ from 'lodash';

import { AppSettingsService } from '../app-settings/app-settings.service';
import { DataCacheService } from '../shared/services/data-cache.service';

@Injectable()
export class OTZRegisterResourceService {
constructor(
protected http: HttpClient,
protected appSettingsService: AppSettingsService,
private cacheService: DataCacheService
) {}

public getBaseUrl(): string {
return this.appSettingsService.getEtlRestbaseurl().trim();
}
public getPatientListUrl(): string {
return (
this.appSettingsService.getEtlRestbaseurl().trim() +
'moh-412-report/patient-list'
);
}

public getOTZMonthlyRegister(payload: any): Observable<any> {
if (!payload) {
return null;
}
let urlParams: HttpParams = new HttpParams()
.set('endDate', payload.endDate)
.set('startDate', payload.startDate)
.set('locationType', payload.locationType);
if (payload.locationUuids) {
if (payload.locationUuids.length > 0) {
urlParams = urlParams.set('locationUuids', payload.locationUuids);
}
}
const url = this.getBaseUrl() + 'otz-register';
const request = this.http.get(url, {
params: urlParams
});
return this.cacheService.cacheRequest(url, urlParams, request);
}

public getMoh412MonthlyReportPatientList(params: any) {
if (!params) {
return null;
}
const urlParams: HttpParams = new HttpParams()
.set('startDate', params.startDate)
.set('endDate', params.endDate)
.set('locationUuids', params.locationUuids)
.set('indicators', params.indicators)
.set('locationType', params.locationType);

const url = this.getPatientListUrl();
const request = this.http.get(url, {
params: urlParams
});
return this.cacheService.cacheRequest(url, urlParams, request);
}
}
41 changes: 41 additions & 0 deletions src/app/etl-api/otz-register.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';

import { Observable, of } from 'rxjs';
import * as _ from 'lodash';

import { AppSettingsService } from '../app-settings/app-settings.service';
import { DataCacheService } from '../shared/services/data-cache.service';

@Injectable()
export class OtzRegisterService {
constructor(
protected http: HttpClient,
protected appSettingsService: AppSettingsService,
private cacheService: DataCacheService
) {}

public getBaseUrl(): string {
return (
this.appSettingsService.getEtlRestbaseurl().trim() +
'otz-monthly-register/patient-list'
);
}

public getOtzRegister(payload: {
endDate: string;
locationUuid: string;
}): Observable<any> {
const url = this.getBaseUrl();
const urlParams: HttpParams = new HttpParams().set(
'endDate',
payload.endDate
);
// .set('locationUuid', payload.locationUuid);
// const request = this.http.get(url);

return this.http.get(url, { params: urlParams });

// return this.cacheService.cacheRequest(url, '', request);
}
}
10 changes: 7 additions & 3 deletions src/app/hiv-care-lib/hiv-care-lib.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ import { AhdMonthlyReportPatientlistComponent } from './ahd-monthly-report/ahd-m
import { PlhivNcdV2ReportBaseComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report-base/plhiv-ncd-v2-report-base.component';
import { PlhivNcdV2ReportPatientListComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report-patient-list/plhiv-ncd-v2-report-patient-list.component';
import { PlhivNcdV2ReportViewComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report-view/plhiv-ncd-v2-report-view.component';
import { RegistersDashboardComponent } from './registers/registers-dashboard.component';
import { OtzRegisterComponent } from './registers/otz/otz-registers/otz-register.component';

@NgModule({
imports: [
Expand Down Expand Up @@ -250,8 +252,8 @@ import { PlhivNcdV2ReportViewComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v
Covid19TabularViewComponent,
PrepMonthlyReportViewComponent,
TxMlReportViewComponent,
AhdReportViewComponent,
PlhivNcdV2ReportViewComponent
RegistersDashboardComponent,
OtzRegisterComponent
],
declarations: [
Moh731TabularComponent,
Expand Down Expand Up @@ -348,7 +350,9 @@ import { PlhivNcdV2ReportViewComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v
AhdMonthlyReportPatientlistComponent,
PlhivNcdV2ReportBaseComponent,
PlhivNcdV2ReportPatientListComponent,
PlhivNcdV2ReportViewComponent
PlhivNcdV2ReportViewComponent,
RegistersDashboardComponent,
OtzRegisterComponent
],
providers: [
MOHReportService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.collapsible-list {
list-style: none;
padding: 0;
}
.item-header {
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px;
background-color: #d9edf7;
border: 1px solid #00acd6;
}
.collapse-icon {
font-weight: bold;
}
.item-details {
padding: 8px;
background-color: #fff;
border: 1px solid #ccc;
}
.setfont {
font-size: 12px !important;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.patient-info {
margin-bottom: 20px;
}
.medication-list {
border-collapse: collapse;
margin: 8px;
}
.medication-list th,
.medication-list td {
border: 1px solid #000000;
padding: 0px;
text-align: left;
}
.footer {
text-align: center;
margin-top: 20px;
}
.setfont {
font-size: 14px !important;
}
.ppadding {
padding-right: 15px;
}

tbody tr {
height: 10px !important;
font-size: 12px !important;
}

tbody tr td {
min-width: 100px;
text-align: center;
}

.alphabets > td {
text-align: center;
}
.alphabets {
background-color: #d9edf7;
}

.exportToExcelBtn {
margin-top: 10px;
padding-bottom: 12px;
}
Loading
Loading