Ejemplo n.º 1
0
 def instantiate_from(self, filename):
     datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or \
               os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'fhir-parser', 'downloads'))
     with io.open(os.path.join(datadir, filename), 'r', encoding='utf-8') as handle:
         js = json.load(handle)
         self.assertEqual("ValueSet", js["resourceType"])
     return valueset.ValueSet(js)
Ejemplo n.º 2
0
    def testValueSet2(self):
        inst = self.instantiate_from("valueset-example-hierarchical.json")
        self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance")
        self.implValueSet2(inst)

        js = inst.as_json()
        self.assertEqual("ValueSet", js["resourceType"])
        inst2 = valueset.ValueSet(js)
        self.implValueSet2(inst2)
Ejemplo n.º 3
0
    def testValueSet7(self):
        inst = self.instantiate_from("valueset-examplescenario-actor-type.json")
        self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance")
        self.implValueSet7(inst)

        js = inst.as_json()
        self.assertEqual("ValueSet", js["resourceType"])
        inst2 = valueset.ValueSet(js)
        self.implValueSet7(inst2)