diff --git a/google-fhir-core/google/fhir/core/fhir_path/_interpreter_test_base.py b/google-fhir-core/google/fhir/core/fhir_path/_interpreter_test_base.py index b352fe0..d2393fa 100644 --- a/google-fhir-core/google/fhir/core/fhir_path/_interpreter_test_base.py +++ b/google-fhir-core/google/fhir/core/fhir_path/_interpreter_test_base.py @@ -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 @@ -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): diff --git a/google-fhir-views/google/fhir/views/fhir_search_runner_test.py b/google-fhir-views/google/fhir/views/fhir_search_runner_test.py index cfcaaa2..aa90e05 100644 --- a/google-fhir-views/google/fhir/views/fhir_search_runner_test.py +++ b/google-fhir-views/google/fhir/views/fhir_search_runner_test.py @@ -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 @@ -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 )()