···5050 )
5151 role = Field(
5252 display="Role",
5353- preview_value={"display": "Test Role"},
5353+ preview_value="Primary care physician",
5454+ mapping=lambda c: c.role.get("display")
5555+ if c.role and c.role.get("display")
5656+ else "",
5457 description="Role of the user in the encounter care team",
5558 )
5659···6164 self.__class__(context=SimpleNamespace(user=c["user_id"], role=c["role"]))
6265 for c in self.context
6366 )
6767+6868+6969+class EncounterFacilityLocationContextBuilder(SingleObjectContextBuilder):
7070+ def get_context(self):
7171+ return getattr(self.parent_context, self.parent_attribute)
7272+7373+ name = Field(
7474+ display="Location Name",
7575+ preview_value="Ward A",
7676+ description="Name of the facility location",
7777+ )
647865796680class EncounterReportContextBase(SingleObjectContextBuilder):
···135149 target_context=FacilityContextBuilder,
136150 preview_value="",
137151 description="Details of the facility where the encounter took place",
152152+ )
153153+ current_location = Field(
154154+ display="Current Location",
155155+ target_context=EncounterFacilityLocationContextBuilder,
156156+ preview_value="",
157157+ description="Current location within the facility for the encounter",
138158 )
139159140160