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

Dashboard rejetion creteria #30

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5d2c0e3
matierialized view update
benzerbett Oct 27, 2021
9935941
chul updates approval - error fix
benzerbett Nov 9, 2021
27c07d4
cleanup facility_filters code, started KHIS-Tracker sync feature (WiP)
benzerbett Jan 5, 2022
5a40f5a
revert tracker sync
benzerbett Jan 5, 2022
379310b
Create dev_requirements.txt
benzerbett Jan 14, 2022
f34cbad
add satellite blood bank to khis facility type mapping
SteveWaweru Feb 7, 2022
a1afaaa
get facility keph level count
abdimoha-dev Jun 2, 2022
1889501
Merge pull request #1 from uonafya/ft-reports-data
abdimoha-dev Jun 2, 2022
67735aa
keph level bug fixes
abdimoha-dev Jun 2, 2022
c50d85a
code cleaup
abdimoha-dev Jun 2, 2022
ca5d5c5
Merge pull request #2 from uonafya/ft-reports-data
abdimoha-dev Jun 2, 2022
c52244a
fix keph level bug
abdimoha-dev Jun 2, 2022
505445e
code cleanup
abdimoha-dev Jun 2, 2022
dca5049
code cleanup
abdimoha-dev Jun 2, 2022
2b900ac
bed count per county
abdimoha-dev Jun 2, 2022
ecf0834
fetch bed per county
abdimoha-dev Jun 3, 2022
05eecfc
changed the format of result given
KorirC Jun 6, 2022
240aaec
user creation
KorirC Sep 11, 2022
67cc382
Create dev_requirements.txt
benzerbett Jan 14, 2022
3f8f6cf
add satellite blood bank to khis facility type mapping
SteveWaweru Feb 7, 2022
e1cc810
Modify: requirements.txt and config/settings/base.py
ertush May 17, 2022
eef575e
updated config/settings/base.py to match mfl_api_testing credentials
ertush Sep 11, 2022
3141465
modified config/settings/base.py
ertush Sep 13, 2022
97300c4
added support for infrastructure and infrastructure_category fields i…
ertush Oct 31, 2022
7f69048
added speciality and speciality category in the filter api
ertush Nov 1, 2022
2e3d9ab
Modified chul/views.py
ertush Dec 5, 2022
3b64f13
working in progress:line 236: facilities/views/facility_views.py
ertush Dec 9, 2022
f4ebf41
modified chus to accept basic_details update and facility_serializers.py
ertush Dec 14, 2022
f641712
modified facility_models.py by updating facility_infrastructure and f…
ertush Dec 28, 2022
b96446b
Merge pull request #3 from uonafya/fx-facility-models
ertush Dec 30, 2022
be2d065
updated config/settings/base.py
ertush Dec 30, 2022
ce4e0b7
Merge pull request #4 from uonafya/fx-config-settings
ertush Dec 30, 2022
212b899
modified facility_reports.py to support report_type filter by beds_an…
ertush Jan 3, 2023
29457de
Merge pull request #5 from uonafya/fx-facility-reports
ertush Jan 3, 2023
cf85fed
Fixed service_filter and added hr_filter, infrastructure_filter funct…
ertush Jan 16, 2023
408f3dd
Merge pull request #6 from uonafya/fx-facility-filters
ertush Jan 16, 2023
f461900
Fixed service_filter and added hr_filter, infrastructure_filter funct…
ertush Jan 16, 2023
e6cd08e
Restored reporting/facility_reports.py
ertush Jan 16, 2023
6b0fefe
Merge pull request #7 from uonafya/fx-facility-filters
ertush Jan 16, 2023
1882cb6
Fixed a bug in update_facility function of facility_models.py
ertush Jan 25, 2023
62c0700
Merge pull request #8 from uonafya/fx-facility-models
ertush Jan 25, 2023
0158a0a
updated kmhfl_dhis2_ownership_mapping in facilities/models/facility_m…
ertush Feb 4, 2023
9f5a8a7
updated kmhfl_dhis2_ownership_mapping in facilities/models/facility_m…
ertush Feb 4, 2023
4bb462e
Merge pull request #9 from uonafya/dev
ertush Feb 5, 2023
02f7c23
Modified facilities/utils.py; line 287
ertush Feb 7, 2023
f920154
added MEDICAL_CLINIC mapping to kmhfl_dhis2_facility_type_mapping in …
ertush Feb 22, 2023
1997d63
modified facilities dashboard to support filtering by sub_county and …
ertush Feb 28, 2023
f7c5c3c
Merge pull request #10 from uonafya/dev
ertush Feb 28, 2023
423b0c9
Added fiedl number_of_inpatient_beds in class Facility of facilities…
ertush Mar 2, 2023
6bd649f
Merge pull request #11 from uonafya/dev
ertush Mar 2, 2023
3f84be2
CHUL Endpoint Fix
Atieno-Ouma Mar 22, 2023
14c999e
Add CU summary dashboard
Atieno-Ouma Mar 29, 2023
2056d49
Facilty status summary
Atieno-Ouma Apr 3, 2023
bd9dba6
Rejected at Validation&Approval endpoint
Atieno-Ouma Apr 5, 2023
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
15 changes: 7 additions & 8 deletions after_disaster_scripts.py
Original file line number Diff line number Diff line change
@@ -78,14 +78,13 @@ def load_wards_and_sub_counties_json_file():
try:
county_obj = County.objects.get(name__contains=county_name)
except:
import pdb
pdb.set_trace()

try:
constituency_obj = Constituency.objects.get(
name=constituency_name, county=county_obj)
except:
import pdb
pdb.set_trace()


try:
sub = SubCounty.objects.get(
name=sub_county_name.lower(), county=county_obj)
@@ -105,8 +104,8 @@ def load_wards_and_sub_counties_json_file():
county_name, constituency_name,
sub_county_name, ward_name)
except:
import pdb
pdb.set_trace()




def delete_unwanted_facilities():
@@ -126,8 +125,8 @@ def delete_unwanted_facilities():
for fc in FacilityContact.everything.filter(facility=facility):
for con in Contact.objects.filter(contact=fc.contact):
con.delete()
import pdb
pdb.set_trace()


fc.delete()

for unit in FacilityUnit.objects.filter(facility=facility):
3 changes: 2 additions & 1 deletion chul/models.py
Original file line number Diff line number Diff line change
@@ -496,9 +496,10 @@ def update_basic_details(self):
'facility').get('facility_id')
basic_details.pop('facility')


for key, value in basic_details.iteritems():
setattr(self.health_unit, key, value)
if 'facility' in basic_details.get('basic'):
if 'basic' in basic_details:
setattr(self.health_unit, 'facility_id', basic_details.get('basic').get('facility'))
self.health_unit.save()

2 changes: 1 addition & 1 deletion common/static/js/ace_editor/snippets/python.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions data/management/commands/data_reports.py
Original file line number Diff line number Diff line change
@@ -83,8 +83,8 @@ def handle(self, *args, **kwargs):
# JobTitle.objects.get(name=jt)
# except JobTitle.DoesNotExist:
# print jt
# import pdb
# pdb.set_trace()
#
#
f_type_name = f_type.split('\n')
print len(f_type_name)
print FacilityType.objects.count()
8 changes: 4 additions & 4 deletions data/management/commands/port_data.py
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@ def _help_create_file(
}
]
json_data = template.render(context) # NOQA
# import pdb
# pdb.set_trace()
#
#
# json_file.write(json_data, indent=4)
json.dump(to_write, json_file, indent=4)

@@ -2323,8 +2323,8 @@ def port_data():
else:
value = obj[field.get("v1_pos")]
except:
import pdb
pdb.set_trace()


if value:
row_data[field.get("v2")] = value
else:
28 changes: 5 additions & 23 deletions facilities/models/facility_models.py
Original file line number Diff line number Diff line change
@@ -1270,6 +1270,9 @@ def push_new_facility(self, code=None):
"93c0fe24-3f12-4be2-b5ff-027e0bd02274": "AaAF5EmS1fk",
"c3bab995-0c29-433c-b39c-6b86d6084f5f": "AaAF5EmS1fk",
"6cb92834-107c-404a-91fa-cf60b1eb5333": "aRxa6o8GqZN",
"2e651780-2ed4-4f8c-9061-6e5acf95d581": "AaAF5EmS1fk",
"30af7e3f-cd52-4ca0-b5dc-d8b1040a9808": "AaAF5EmS1fk",
"d64bbd8a-4013-463b-a238-c346cee66a92": "AaAF5EmS1fk",
}
kmhfl_dhis2_keph_mapping = {
"ed23da85-4c92-45af-80fa-9b2123769f49": "FpY8vg4gh46",
@@ -1603,26 +1606,6 @@ def get_facility_specialities(self):
for h_r in hr
]

# @property
# def get_facility_humanresources(self):
# """For the same purpose as the get_facility_infra... above"""

# import pdb
# pdb.set_trace()

# hr = self.facility_humanresources.all()


# return [
# {
# "id": h_r.id,
# "name": h_r.speciality.name,
# "count": h_r.count,
# "hr_category": h_r.speciality.category.id,
# "hr_category_name": str(h_r.speciality.category.name),
# }
# for h_r in hr
# ]

@property
def average_rating(self):
@@ -2067,8 +2050,7 @@ def update_facility(self):
new_date = datetime.date(year=value.year, month=value.month, day=value.day)
value = new_date
elif field_name == 'sub_county_id':
import string
value = SubCounty.objects.get(name=string.capwords(field_changed.get('display_value'), ' ')).id
value = SubCounty.objects.get(id=field_changed.get('actual_value')).id
else:
value = field_changed.get("actual_value")

@@ -3021,7 +3003,7 @@ class FacilityInfrastructure(AbstractBase):
infrastructure = models.ForeignKey(
Infrastructure,
related_name='infrastructure',
on_delete=models.PROTECT,)
on_delete=models.PROTECT,)

count = models.IntegerField(
default=0,
6 changes: 3 additions & 3 deletions facilities/views/static_reports_view.py
Original file line number Diff line number Diff line change
@@ -34,17 +34,17 @@ def get_chu_count_in_ward_summary(self, ward):
facility__ward=ward).count()

def get_bed_count(self, location):
import pdb

if location:

pdb.set_trace()

# for keph in keph_level:
# objects.values('Category').distinct()
facility_beds_details = Facility.objects.values("number_of_cots", "number_of_beds","number_of_hdu_beds", "number_of_icu_beds", "number_of_isolation_beds","number_of_maternity_beds","owner_id","county_id", "facility_type_id","keph_level_id", "sub_county_id","ward_id", ward__sub_county__county=location)

return "keph_array"
else:
# pdb.set_trace()
#
counties = County.objects.values("id","name","code")
facility_beds_details = Facility.objects.values("number_of_cots", "number_of_beds","number_of_hdu_beds", "number_of_icu_beds", "number_of_isolation_beds","number_of_maternity_beds","owner_id","county_id", "facility_type_id","keph_level_id", "sub_county_id","ward_id")
counties_beds_array = []
18 changes: 9 additions & 9 deletions load_all_facilities.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ def load_missed_facilities():
try:
county = County.objects.filter(name__icontains=county_name)[0]
except IndexError:
import pdb; pdb.set_trace()
;

print county, record.get('county')
reg_body = None
@@ -59,8 +59,8 @@ def load_missed_facilities():
try:
operation_status = FacilityStatus.objects.get(name=record.get('operation_status').get('name'))
except AttributeError:
import pdb
pdb.set_trace()



facility_data = {
"code": int(record.get('code')),
@@ -94,7 +94,7 @@ def load_missed_facilities():
try:
ward = prob_ward.filter(name__icontains=fac_ward.get('ward'))[0]
except:
import pdb;pdb.set_trace()
;
facility_data['ward'] = ward
try:
Facility.objects.get(code=int(record.get('code')))
@@ -108,7 +108,7 @@ def load_missed_facilities():
except:
pass

# import pdb; pdb.set_trace()
# ;
break

return len(facs_created)
@@ -117,7 +117,7 @@ def load_missed_facilities():
# # try:
# # Facility(**facility_data).save()
# # except:
# # import pdb; pdb.set_trace()
# # ;
# try:
# facility = Facility.objects.get(code=record.get('code'))
# facility.county = county
@@ -206,13 +206,13 @@ def map_facility_types():
try:
facility_type_obj = FacilityType.objects.get(name=new_type)
except FacilityType.DoesNotExist:
import pdb
pdb.set_trace()


facility.facility_type = facility_type_obj
try:
facility.save(allow_save=True)
except:
import pdb;pdb.set_trace()
;



10 changes: 5 additions & 5 deletions scripts.py
Original file line number Diff line number Diff line change
@@ -70,21 +70,21 @@ def move_facitlies_to_correct_ward(file_path=None):
try:
county = County.objects.filter(name__icontains=county_name)[0]
except IndexError:
import pdb; pdb.set_trace()
;

prob_ward = Ward.objects.filter(constituency__county=county)
try:
ward = prob_ward.filter(name__icontains=record.get('ward'))[0]
except IndexError:
import pdb
pdb.set_trace()


fac.ward = ward
print county, ward
try:
fac.save(allow_save=True)
except:
import pdb
pdb.set_trace()




def determine_facilites_already_in_system():