Skip to content

Commit

Permalink
Merge pull request #2466 from ohcnetwork/develop
Browse files Browse the repository at this point in the history
Staging Release v24.39.3
  • Loading branch information
khavinshankar authored Sep 19, 2024
2 parents bf4767d + a06913e commit 1d69bc9
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 51 deletions.
14 changes: 13 additions & 1 deletion care/facility/api/serializers/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,19 @@


class PatientMetaInfoSerializer(serializers.ModelSerializer):
occupation = ChoiceField(choices=PatientMetaInfo.OccupationChoices, allow_null=True)
occupation = ChoiceField(
choices=PatientMetaInfo.OccupationChoices, allow_null=True, required=False
)
socioeconomic_status = ChoiceField(
choices=PatientMetaInfo.SocioeconomicStatus.choices,
allow_null=True,
required=False,
)
domestic_healthcare_support = ChoiceField(
choices=PatientMetaInfo.DomesticHealthcareSupport.choices,
allow_null=True,
required=False,
)

class Meta:
model = PatientMetaInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 4.2.10 on 2024-09-19 07:07

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("facility", "0456_dailyround_appetite_dailyround_bladder_drainage_and_more"),
]

operations = [
migrations.AddField(
model_name="patientmetainfo",
name="domestic_healthcare_support",
field=models.SmallIntegerField(
blank=True,
choices=[
(0, "NO_SUPPORT"),
(10, "FAMILY_MEMBER"),
(20, "PAID_CAREGIVER"),
],
null=True,
),
),
migrations.AddField(
model_name="patientmetainfo",
name="socioeconomic_status",
field=models.SmallIntegerField(
blank=True,
choices=[
(10, "VERY_POOR"),
(20, "POOR"),
(30, "MIDDLE_CLASS"),
(40, "WELL_OFF"),
],
null=True,
),
),
]
83 changes: 50 additions & 33 deletions care/facility/models/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,43 +589,60 @@ def format_diagnoses(diagnosis_ids):


class PatientMetaInfo(models.Model):
class OccupationEnum(enum.Enum):
STUDENT = 1
BUSINESSMAN = 2
HEALTH_CARE_WORKER = 3
HEALTH_CARE_LAB_WORKER = 4
ANIMAL_HANDLER = 5
OTHERS = 6
HEALTHCARE_PRACTITIONER = 7
PARADEMICS = 8
BUSINESS_RELATED = 9
ENGINEER = 10
TEACHER = 11
OTHER_PROFESSIONAL_OCCUPATIONS = 12
OFFICE_ADMINISTRATIVE = 13
CHEF = 14
PROTECTIVE_SERVICE = 15
HOSPITALITY = 16
CUSTODIAL = 17
CUSTOMER_SERVICE = 18
SALES_SUPERVISOR = 19
RETAIL_SALES_WORKER = 20
INSURANCE_SALES_AGENT = 21
SALES_REPRESENTATIVE = 22
REAL_ESTATE = 23
CONSTRUCTION_EXTRACTION = 24
AGRI_NATURAL = 25
PRODUCTION_OCCUPATION = 26
PILOT_FLIGHT = 27
VEHICLE_DRIVER = 28
MILITARY = 29
HOMEMAKER = 30
UNKNOWN = 31
NOT_APPLICABLE = 32
class OccupationEnum(models.IntegerChoices):
STUDENT = 1, "STUDENT"
BUSINESSMAN = 2, "BUSINESSMAN"
HEALTH_CARE_WORKER = 3, "HEALTH_CARE_WORKER"
HEALTH_CARE_LAB_WORKER = 4, "HEALTH_CARE_LAB_WORKER"
ANIMAL_HANDLER = 5, "ANIMAL_HANDLER"
OTHERS = 6, "OTHERS"
HEALTHCARE_PRACTITIONER = 7, "HEALTHCARE_PRACTITIONER"
PARADEMICS = 8, "PARADEMICS"
BUSINESS_RELATED = 9, "BUSINESS_RELATED"
ENGINEER = 10, "ENGINEER"
TEACHER = 11, "TEACHER"
OTHER_PROFESSIONAL_OCCUPATIONS = 12, "OTHER_PROFESSIONAL_OCCUPATIONS"
OFFICE_ADMINISTRATIVE = 13, "OFFICE_ADMINISTRATIVE"
CHEF = 14, "CHEF"
PROTECTIVE_SERVICE = 15, "PROTECTIVE_SERVICE"
HOSPITALITY = 16, "HOSPITALITY"
CUSTODIAL = 17, "CUSTODIAL"
CUSTOMER_SERVICE = 18, "CUSTOMER_SERVICE"
SALES_SUPERVISOR = 19, "SALES_SUPERVISOR"
RETAIL_SALES_WORKER = 20, "RETAIL_SALES_WORKER"
INSURANCE_SALES_AGENT = 21, "INSURANCE_SALES_AGENT"
SALES_REPRESENTATIVE = 22, "SALES_REPRESENTATIVE"
REAL_ESTATE = 23, "REAL_ESTATE"
CONSTRUCTION_EXTRACTION = 24, "CONSTRUCTION_EXTRACTION"
AGRI_NATURAL = 25, "AGRI_NATURAL"
PRODUCTION_OCCUPATION = 26, "PRODUCTION_OCCUPATION"
PILOT_FLIGHT = 27, "PILOT_FLIGHT"
VEHICLE_DRIVER = 28, "VEHICLE_DRIVER"
MILITARY = 29, "MILITARY"
HOMEMAKER = 30, "HOMEMAKER"
UNKNOWN = 31, "UNKNOWN"
NOT_APPLICABLE = 32, "NOT_APPLICABLE"

OccupationChoices = [(item.value, item.name) for item in OccupationEnum]

class SocioeconomicStatus(models.IntegerChoices):
VERY_POOR = 10, "VERY_POOR"
POOR = 20, "POOR"
MIDDLE_CLASS = 30, "MIDDLE_CLASS"
WELL_OFF = 40, "WELL_OFF"

class DomesticHealthcareSupport(models.IntegerChoices):
NO_SUPPORT = 0, "NO_SUPPORT"
FAMILY_MEMBER = 10, "FAMILY_MEMBER"
PAID_CAREGIVER = 20, "PAID_CAREGIVER"

occupation = models.IntegerField(choices=OccupationChoices, blank=True, null=True)
socioeconomic_status = models.SmallIntegerField(
choices=SocioeconomicStatus.choices, blank=True, null=True
)
domestic_healthcare_support = models.SmallIntegerField(
choices=DomesticHealthcareSupport.choices, blank=True, null=True
)
head_of_household = models.BooleanField(blank=True, null=True)


Expand Down
21 changes: 21 additions & 0 deletions care/facility/tests/test_patient_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,27 @@ def setUpTestData(cls):
def get_base_url(self) -> str:
return "/api/v1/patient/"

def test_update_patient_with_meta_info(self):
self.client.force_authenticate(user=self.user)
res = self.client.patch(
f"{self.get_base_url()}{self.patient.external_id}/",
data={
"meta_info": {
"socioeconomic_status": "VERY_POOR",
"domestic_healthcare_support": "FAMILY_MEMBER",
}
},
format="json",
)
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertDictContainsSubset(
{
"socioeconomic_status": "VERY_POOR",
"domestic_healthcare_support": "FAMILY_MEMBER",
},
res.data.get("meta_info"),
)

def test_has_consent(self):
self.client.force_authenticate(user=self.user)
response = self.client.get(self.get_base_url())
Expand Down
12 changes: 8 additions & 4 deletions care/hcx/utils/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,10 @@ def process_coverage_elibility_check_response(self, response):
coverageeligibilityresponse.CoverageEligibilityResponse(
**list(
filter(
lambda entry: entry.resource
is coverageeligibilityresponse.CoverageEligibilityResponse,
lambda entry: isinstance(
entry.resource,
coverageeligibilityresponse.CoverageEligibilityResponse,
),
coverage_eligibility_check_bundle.entry,
)
)[0].resource.dict()
Expand All @@ -1027,7 +1029,7 @@ def process_coverage_elibility_check_response(self, response):
coverage_request = coverage.Coverage(
**list(
filter(
lambda entry: entry.resource is coverage.Coverage,
lambda entry: isinstance(entry.resource, coverage.Coverage),
coverage_eligibility_check_bundle.entry,
)
)[0].resource.dict()
Expand Down Expand Up @@ -1057,7 +1059,9 @@ def process_claim_response(self, response):
claim_response = claimresponse.ClaimResponse(
**list(
filter(
lambda entry: entry.resource is claimresponse.ClaimResponse,
lambda entry: isinstance(
entry.resource, claimresponse.ClaimResponse
),
claim_bundle.entry,
)
)[0].resource.dict()
Expand Down
6 changes: 3 additions & 3 deletions locale/hi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: ohccarefe\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-25 17:02+0530\n"
"PO-Revision-Date: 2024-09-16 10:57\n"
"PO-Revision-Date: 2024-09-16 14:40\n"
"Last-Translator: \n"
"Language-Team: Hindi\n"
"Language: hi_IN\n"
Expand All @@ -14,8 +14,8 @@ msgstr ""
"X-Crowdin-Project: ohccarefe\n"
"X-Crowdin-Project-ID: 704503\n"
"X-Crowdin-Language: hi\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/ta/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 70\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/kn/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 76\n"

#: care/abdm/apps.py:7
msgid "ABDM Integration"
Expand Down
6 changes: 3 additions & 3 deletions locale/kn/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: ohccarefe\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-25 17:02+0530\n"
"PO-Revision-Date: 2024-09-16 10:57\n"
"PO-Revision-Date: 2024-09-16 12:34\n"
"Last-Translator: \n"
"Language-Team: Kannada\n"
"Language: kn_IN\n"
Expand All @@ -14,8 +14,8 @@ msgstr ""
"X-Crowdin-Project: ohccarefe\n"
"X-Crowdin-Project-ID: 704503\n"
"X-Crowdin-Language: kn\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/ta/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 70\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/kn/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 76\n"

#: care/abdm/apps.py:7
msgid "ABDM Integration"
Expand Down
8 changes: 4 additions & 4 deletions locale/ml/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: ohccarefe\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-25 17:02+0530\n"
"PO-Revision-Date: 2024-09-16 10:58\n"
"PO-Revision-Date: 2024-09-16 12:34\n"
"Last-Translator: \n"
"Language-Team: Malayalam\n"
"Language: ml_IN\n"
Expand All @@ -14,8 +14,8 @@ msgstr ""
"X-Crowdin-Project: ohccarefe\n"
"X-Crowdin-Project-ID: 704503\n"
"X-Crowdin-Language: ml-IN\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/ta/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 70\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/kn/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 76\n"

#: care/abdm/apps.py:7
msgid "ABDM Integration"
Expand Down Expand Up @@ -116,7 +116,7 @@ msgstr "HCX ഇൻ്റഗ്രേഷൻ"

#: care/templates/pages/home.html:8
msgid "Open Healthcare Network"
msgstr "ആരോഗ്യ സംരക്ഷണ ശൃംഖല"
msgstr "ഹെൽത്ത് കെയർ നെറ്റ്‌വർക്ക് തുറക്കുക"

#: care/templates/pages/home.html:9
msgid "Our Goal is to defend the Healthcare system of Kerala from overloading beyond capacity."
Expand Down
6 changes: 3 additions & 3 deletions locale/ta/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: ohccarefe\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-25 17:02+0530\n"
"PO-Revision-Date: 2024-09-16 10:57\n"
"PO-Revision-Date: 2024-09-16 14:40\n"
"Last-Translator: \n"
"Language-Team: Tamil\n"
"Language: ta_IN\n"
Expand All @@ -14,8 +14,8 @@ msgstr ""
"X-Crowdin-Project: ohccarefe\n"
"X-Crowdin-Project-ID: 704503\n"
"X-Crowdin-Language: ta\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/ta/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 70\n"
"X-Crowdin-File: /[ohcnetwork.care] develop/locale/kn/LC_MESSAGES/django.po\n"
"X-Crowdin-File-ID: 76\n"

#: care/abdm/apps.py:7
msgid "ABDM Integration"
Expand Down

0 comments on commit 1d69bc9

Please sign in to comment.