Skip to content

Commit

Permalink
Minor Updates and Fixes (#719)
Browse files Browse the repository at this point in the history
* stale check

* zaproxy scan

* minor changes

* remove zproxy

* Fix Pagination for ShiftingBoard

* Minor Fix for Shifting Boards pagination

* Re-order user types

Co-authored-by: syam <[email protected]>
Co-authored-by: bodhisha <[email protected]>
  • Loading branch information
3 people authored Sep 23, 2020
1 parent d187ef5 commit 49a09ef
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 39 deletions.
18 changes: 18 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- leapcode
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions. Feel free to repopen the issue.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/200482ab117e4b5397ff3f5ae5719aa2)](https://www.codacy.com/gh/coronasafe/care_fe?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=coronasafe/care_fe&amp;utm_campaign=Badge_Grade)
[![CircleCI](https://circleci.com/gh/coronasafe/care_fe.svg?style=svg)](https://circleci.com/gh/coronasafe/care_fe)
[![Maintainability](https://api.codeclimate.com/v1/badges/f1438f693aa459805301/maintainability)](https://codeclimate.com/github/coronasafe/care_fe/maintainability)
[![DepShield Badge](https://depshield.sonatype.org/badges/coronasafe/care_fe/depshield.svg)](https://depshield.github.io)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcoronasafe%2Fcare_fe.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcoronasafe%2Fcare_fe?ref=badge_large)


Auto Deployed to https://care.coronasafe.in for Develop Branch.


Expand Down
98 changes: 60 additions & 38 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export interface OptionsType {
id: number;
text: string;
Expand All @@ -12,8 +11,8 @@ export const USER_TYPES: Array<String> = [
"Staff",
"StaffReadOnly",
"Doctor",
"DistrictAdmin",
"DistrictReadOnlyAdmin",
"DistrictAdmin",
"DistrictLabAdmin",
"StateLabAdmin",
"StateAdmin",
Expand Down Expand Up @@ -50,13 +49,13 @@ export const DISTRICT_CHOICES: Array<OptionsType> = [
{ id: 11, text: "Kozhikode" },
{ id: 12, text: "Wayanad" },
{ id: 13, text: "Kannur" },
{ id: 14, text: "Kasaragod" }
{ id: 14, text: "Kasaragod" },
];

export const VEHICLE_TYPES: Array<OptionsType> = [
{ id: 1, text: "Basic" },
{ id: 2, text: "Cardiac" },
{ id: 3, text: "Hearse" }
{ id: 3, text: "Hearse" },
];

export const FACILITY_TYPES: Array<OptionsType> = [
Expand All @@ -67,8 +66,8 @@ export const FACILITY_TYPES: Array<OptionsType> = [
{ id: 5, text: "Hotel" },
{ id: 6, text: "Lodge" },
{ id: 7, text: "TeleMedicine" },
{ id: 8, text: 'Govt Hospital' },
{ id: 9, text: 'Labs' },
{ id: 8, text: "Govt Hospital" },
{ id: 9, text: "Labs" },
{ id: 800, text: "Primary Health Centres" },
{ id: 801, text: "24x7 Public Health Centres" },
{ id: 802, text: "Family Health Centres" },
Expand All @@ -80,11 +79,11 @@ export const FACILITY_TYPES: Array<OptionsType> = [
{ id: 850, text: "General hospitals" },
{ id: 860, text: "District Hospitals" },
{ id: 870, text: "Govt Medical College Hospitals" },
{ id: 950, text: 'Corona Testing Labs' },
{ id: 950, text: "Corona Testing Labs" },
{ id: 1000, text: "Corona Care Centre" },
{ id: 1100, text: "First Line Treatment Centre" },
{ id: 1200, text: "Second Line Treatment Center" },
{ id: 1300, text: "Shifting Centre" }
{ id: 1300, text: "Shifting Centre" },
];

export const SHIFTING_CHOICES: Array<OptionsType> = [
Expand All @@ -104,15 +103,15 @@ export const BED_TYPES: Array<OptionsType> = [
{ id: 3, text: "Single Room with Attached Bathroom" },
{ id: 10, text: "ICU" },
{ id: 20, text: "Ventilator" },
{ id: 30, text: "Covid Beds" }
{ id: 30, text: "Covid Beds" },
];

export const DOCTOR_SPECIALIZATION: Array<OptionsType> = [
{ id: 1, text: "General Medicine" },
{ id: 2, text: "Pulmonology" },
{ id: 3, text: "Critical Care" },
{ id: 4, text: "Paediatrics" },
{ id: 5, text: "Other Speciality" }
{ id: 5, text: "Other Speciality" },
];

export const MEDICAL_HISTORY_CHOICES: Array<OptionsType> = [
Expand All @@ -123,7 +122,7 @@ export const MEDICAL_HISTORY_CHOICES: Array<OptionsType> = [
{ id: 5, text: "Kidney Diseases" },
{ id: 6, text: "Lung Diseases/Asthma" },
{ id: 7, text: "Cancer" },
{ id: 8, text: "OTHER" }
{ id: 8, text: "OTHER" },
];

export const SYMPTOM_CHOICES: Array<OptionsType> = [
Expand All @@ -148,7 +147,7 @@ export const SYMPTOM_CHOICES: Array<OptionsType> = [
export const GENDER_TYPES: Array<OptionsType> = [
{ id: 1, text: "Male" },
{ id: 2, text: "Female" },
{ id: 3, text: "Other" }
{ id: 3, text: "Other" },
];

export const SAMPLE_TEST_RESULT = [
Expand All @@ -163,7 +162,7 @@ export const CONSULTATION_SUGGESTION = [
{ id: "A", text: "Admission" },
{ id: "R", text: "Refer to another Hospital" },
{ id: "OP", text: "OP Consultation" },
{ id: "DC", text: "Domiciliary Care" }
{ id: "DC", text: "Domiciliary Care" },
];

export const ADMITTED_TO = [
Expand All @@ -174,47 +173,72 @@ export const ADMITTED_TO = [
"ICU with Invasive Ventilator",
"Home Isolation",
"Gynaecology Ward",
"Paediatric Ward"
"Paediatric Ward",
];

export const PATIENT_CATEGORY = [
{ id: "ASYMPTOMATIC", text: "ASYM (ASYMPTOMATIC) " },
{ id: "Category-A", text: "Mild (Category A)" },
{ id: "Category-B", text: "Moderate (Category B)" },
{ id: "Category-C", text: "Severe (Category C)" }
{ id: "Category-C", text: "Severe (Category C)" },
];

export const CURRENT_HEALTH_CHANGE = [
{ id: 0, text: 'NO DATA', desc: '', },
{ id: 3, text: 'STATUS QUO', desc: 'No Change' },
{ id: 4, text: 'BETTER', desc: 'Better' },
{ id: 2, text: 'WORSE', desc: 'Worse' },
{ id: 1, text: 'REQUIRES VENTILATOR', desc: 'Requires Ventilator' },
{ id: 0, text: "NO DATA", desc: "" },
{ id: 3, text: "STATUS QUO", desc: "No Change" },
{ id: 4, text: "BETTER", desc: "Better" },
{ id: 2, text: "WORSE", desc: "Worse" },
{ id: 1, text: "REQUIRES VENTILATOR", desc: "Requires Ventilator" },
];

export const SAMPLE_TEST_STATUS = [
{ id: 1, text: "REQUEST_SUBMITTED", desc: "Request Submitted" },
{ id: 2, text: "APPROVED", desc: "Approved for Sample Collection" },
{ id: 3, text: "DENIED", desc: "Request Denied" },
{ id: 4, text: "SENT_TO_COLLECTON_CENTRE", desc: "Sample taken and sent to collection centre" },
{
id: 4,
text: "SENT_TO_COLLECTON_CENTRE",
desc: "Sample taken and sent to collection centre",
},
{ id: 5, text: "RECEIVED_AND_FORWARED", desc: "Received And Forwarded" },
{ id: 6, text: "RECEIVED_AT_LAB", desc: "Received At Lab" },
{ id: 7, text: "COMPLETED", desc: "Test Completed" },
];

export const SAMPLE_FLOW_RULES = {
REQUEST_SUBMITTED: ["APPROVED", "DENIED",],
APPROVED: ["SENT_TO_COLLECTON_CENTRE", "RECEIVED_AND_FORWARED", "RECEIVED_AT_LAB", "COMPLETED"],
REQUEST_SUBMITTED: ["APPROVED", "DENIED"],
APPROVED: [
"SENT_TO_COLLECTON_CENTRE",
"RECEIVED_AND_FORWARED",
"RECEIVED_AT_LAB",
"COMPLETED",
],
DENIED: ["REQUEST_SUBMITTED"],
SENT_TO_COLLECTON_CENTRE: ["RECEIVED_AND_FORWARED", "RECEIVED_AT_LAB", "COMPLETED"],
SENT_TO_COLLECTON_CENTRE: [
"RECEIVED_AND_FORWARED",
"RECEIVED_AT_LAB",
"COMPLETED",
],
RECEIVED_AND_FORWARED: ["RECEIVED_AT_LAB", "COMPLETED"],
RECEIVED_AT_LAB: ["COMPLETED"],
};

export const ROLE_STATUS_MAP = {
Staff: ["SENT_TO_COLLECTON_CENTRE"],
DistrictAdmin: ["APPROVED", "DENIED", "SENT_TO_COLLECTON_CENTRE", "RECEIVED_AND_FORWARED"],
StateLabAdmin: ["APPROVED", "DENIED", "SENT_TO_COLLECTON_CENTRE", "RECEIVED_AND_FORWARED", "RECEIVED_AT_LAB", "COMPLETED"],
DistrictAdmin: [
"APPROVED",
"DENIED",
"SENT_TO_COLLECTON_CENTRE",
"RECEIVED_AND_FORWARED",
],
StateLabAdmin: [
"APPROVED",
"DENIED",
"SENT_TO_COLLECTON_CENTRE",
"RECEIVED_AND_FORWARED",
"RECEIVED_AT_LAB",
"COMPLETED",
],
};

export const DISEASE_STATUS = [
Expand All @@ -226,9 +250,7 @@ export const DISEASE_STATUS = [
"EXPIRED",
];

export const TEST_TYPE = [
"UNK", "ANTIGEN", "RTPCR", "CBNAT", "TRUNAT"
];
export const TEST_TYPE = ["UNK", "ANTIGEN", "RTPCR", "CBNAT", "TRUNAT"];

export const BLOOD_GROUPS = [
"UNK",
Expand Down Expand Up @@ -260,14 +282,14 @@ export const ICMR_CATEGORY = [
"Cat 4",
"Cat 5a",
"Cat 5b",
]
];

export const TELEMEDICINE_ACTIONS = [
{ id: 10, text: 'PENDING', desc: "Pending" },
{ id: 30, text: 'SPECIALIST_REQUIRED', desc: "Specialist Required" },
{ id: 40, text: 'PLAN_FOR_HOME_CARE', desc: "Plan for Home Care" },
{ id: 50, text: 'FOLLOW_UP_NOT_REQUIRED', desc: "Follow Up Not Required" },
{ id: 60, text: 'COMPLETE', desc: "Complete" },
{ id: 70, text: 'REVIEW', desc: "Review" },
{ id: 80, text: 'NOT_REACHABLE', desc: "Not Reachable" }
]
{ id: 10, text: "PENDING", desc: "Pending" },
{ id: 30, text: "SPECIALIST_REQUIRED", desc: "Specialist Required" },
{ id: 40, text: "PLAN_FOR_HOME_CARE", desc: "Plan for Home Care" },
{ id: 50, text: "FOLLOW_UP_NOT_REQUIRED", desc: "Follow Up Not Required" },
{ id: 60, text: "COMPLETE", desc: "Complete" },
{ id: 70, text: "REVIEW", desc: "Review" },
{ id: 80, text: "NOT_REACHABLE", desc: "Not Reachable" },
];
3 changes: 2 additions & 1 deletion src/Components/Shifting/ShiftingBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default function ListView({ board, filterProp, formatFilter }: boardProps
if (res && res.data) {
setData(res.data.results);
setTotalCount(res.data.count);
setCurrentPage(1);
}
setIsLoading(loading => reduceLoading("COMPLETE", loading));
});
Expand All @@ -71,13 +72,13 @@ export default function ListView({ board, filterProp, formatFilter }: boardProps

const handlePagination = (page: number, limit: number) => {
const offset = (page - 1) * limit;
// console.log(`${currentPage} of ${(totalCount || 0)/limit} to ${page}`)
setCurrentPage(page);
setIsLoading(loading => reduceLoading("MORE", loading));
dispatch(getShiftRequests(formatFilter({ ...filterProp, status: board, offset: offset }), board)).then((res: any) => {
if (res && res.data) {
setData(data => [...data, ...res.data.results]);
setTotalCount(res.data.count);
setCurrentPage(1)
}
setIsLoading(loading => reduceLoading("COMPLETE", loading));
});
Expand Down

0 comments on commit 49a09ef

Please sign in to comment.