Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 686142385
  • Loading branch information
anandolee authored and copybara-github committed Oct 15, 2024
1 parent 1b4e059 commit 287022e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing import List, Union, cast
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import symbol_database
from google.protobuf import message_factory
from absl.testing import parameterized
from google.fhir.core.fhir_path import _evaluation
from google.fhir.core.fhir_path import _fhir_path_data_types
Expand Down Expand Up @@ -67,12 +67,10 @@ def observation_descriptor(self) -> descriptor.Descriptor:
pass

def _new_patient(self):
return symbol_database.Default().GetPrototype(self.patient_descriptor())()
return message_factory.GetMessageClass(self.patient_descriptor())()

def _new_observation(self):
return symbol_database.Default().GetPrototype(
self.observation_descriptor()
)()
return message_factory.GetMessageClass(self.observation_descriptor())()

@abc.abstractmethod
def value_set_builder(self, url: str):
Expand Down
10 changes: 4 additions & 6 deletions google-fhir-views/google/fhir/views/fhir_search_runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import pandas as pd

from google.protobuf import symbol_database
from google.protobuf import message_factory
from absl.testing import absltest
from google.fhir.r4.proto.core.resources import bundle_and_contained_resource_pb2
from google.fhir.r4.proto.core.resources import observation_pb2
Expand All @@ -33,17 +33,15 @@
class FhirSearchRunnerTest(absltest.TestCase):

def _new_patient(self):
return symbol_database.Default().GetPrototype(
patient_pb2.Patient.DESCRIPTOR
)()
return message_factory.GetMessageClass(patient_pb2.Patient.DESCRIPTOR)()

def _new_observation(self):
return symbol_database.Default().GetPrototype(
return message_factory.GetMessageClass(
observation_pb2.Observation.DESCRIPTOR
)()

def _new_bundle(self):
return symbol_database.Default().GetPrototype(
return message_factory.GetMessageClass(
bundle_and_contained_resource_pb2.Bundle.DESCRIPTOR
)()

Expand Down

0 comments on commit 287022e

Please sign in to comment.