this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'develop' of github.com:ohcnetwork/care into develop

+25 -3
+21 -1
care/emr/reports/context_builder/data_points/encounter.py
··· 50 50 ) 51 51 role = Field( 52 52 display="Role", 53 - preview_value={"display": "Test Role"}, 53 + preview_value="Primary care physician", 54 + mapping=lambda c: c.role.get("display") 55 + if c.role and c.role.get("display") 56 + else "", 54 57 description="Role of the user in the encounter care team", 55 58 ) 56 59 ··· 61 64 self.__class__(context=SimpleNamespace(user=c["user_id"], role=c["role"])) 62 65 for c in self.context 63 66 ) 67 + 68 + 69 + class EncounterFacilityLocationContextBuilder(SingleObjectContextBuilder): 70 + def get_context(self): 71 + return getattr(self.parent_context, self.parent_attribute) 72 + 73 + name = Field( 74 + display="Location Name", 75 + preview_value="Ward A", 76 + description="Name of the facility location", 77 + ) 64 78 65 79 66 80 class EncounterReportContextBase(SingleObjectContextBuilder): ··· 135 149 target_context=FacilityContextBuilder, 136 150 preview_value="", 137 151 description="Details of the facility where the encounter took place", 152 + ) 153 + current_location = Field( 154 + display="Current Location", 155 + target_context=EncounterFacilityLocationContextBuilder, 156 + preview_value="", 157 + description="Current location within the facility for the encounter", 138 158 ) 139 159 140 160
+4 -2
care/emr/reports/context_builder/data_points/medication.py
··· 1 + from decimal import Decimal 2 + 1 3 from django_filters import rest_framework as filters 2 4 3 5 from care.emr.models.medication_request import ( ··· 59 61 dosage = Field( 60 62 display="Dosage", 61 63 mapping=lambda d: ( 62 - f"{int(d.get('dose_and_rate', {}).get('dose_quantity', {}).get('value', 0)) if d.get('dose_and_rate', {}).get('dose_quantity', {}).get('value', 0) % 1 == 0 else d.get('dose_and_rate', {}).get('dose_quantity', {}).get('value', '')} " 64 + f"{int(d.get('dose_and_rate', {}).get('dose_quantity', {}).get('value', 0)) if Decimal(d.get('dose_and_rate', {}).get('dose_quantity', {}).get('value', 0)) % 1 == 0 else d.get('dose_and_rate', {}).get('dose_quantity', {}).get('value', '')} " 63 65 f"{d.get('dose_and_rate', {}).get('dose_quantity', {}).get('unit', {}).get('display', '')}" 64 66 if d.get("dose_and_rate") 65 67 and d.get("dose_and_rate", {}).get("dose_quantity") ··· 81 83 duration = Field( 82 84 display="Duration", 83 85 mapping=lambda d: ( 84 - f"{int(d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('value', 0)) if d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('value', 0) % 1 == 0 else d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('value', '')} " 86 + f"{int(d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('value', 0)) if Decimal(d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('value', 0)) % 1 == 0 else d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('value', '')} " 85 87 f"{d.get('timing', {}).get('repeat', {}).get('bounds_duration', {}).get('unit', '')}" 86 88 if d.get("timing", {}).get("repeat", {}).get("bounds_duration") 87 89 else ""