def test_read_relationship_file(spark_session): ancestors = with_relationships( spark_session, create_hierarchies(spark_session), 'tests/resources/SNOMED_RELATIONSHIP_SAMPLE.TXT', '20160901').get_ancestors() assert set(ancestors.columns) == EXPECTED_COLUMNS
def test_isa_snomed(spark_session): spark_session.sql('create database isa_snomed_ontologies') with_relationships( spark_session, create_hierarchies(spark_session), 'tests/resources/SNOMED_RELATIONSHIP_SAMPLE.TXT', '20160901') \ .write_to_database('isa_snomed_ontologies') create_value_sets(spark_session).write_to_database('isa_snomed_ontologies') push_valuesets(spark_session, {'diabetes' : isa_snomed('73211009')}, database = 'isa_snomed_ontologies') expected = {'diabetes' : [('http://snomed.info/sct', '73211009'), ('http://snomed.info/sct', '44054006')]} assert get_current_valuesets(spark_session) == expected