Converters

converters.resources.age_to_fhir(obj, mapping, field)

Generic function to convert Phenopackets Age or AgeRange to FHIR Age.

Parameters
  • obj – object to which field Age or AgeRange belongs to

  • mapping – mapping from PHENOPACKETS_ON_FHIR

  • field – name of the field that stores age

Returns

age extension object

converters.resources.biosample_to_fhir(obj)

Converts Biosample to FHIR Specimen.

Parameters

obj – Biosample json

Returns

FHIR Specimen json

converters.resources.check_disease_onset(disease)

Phenopackets schema allows age to be represented by ISO8601 string, whereis Pheno-FHIR guide requires it to be represented by CodeableConcept. This function checks how age is represented in data.

Parameters

disease – disease json object

Returns

True/False

converters.resources.codeable_concepts_fields(field_list, profile, obj)

Converts a list of fields to FHIR CodeableConcepts and returns a list of extensions.

Parameters
  • field_list – fields to convert to codeable concepts

  • profile – name of an object in phenopackets mappings

  • obj – object to which fields belong to

Returns

list of extensions

converters.resources.disease_to_fhir(obj)

Converts Disease to FHIR Condition.

Parameters

obj – Disease json

Returns

FHIR Condition json

converters.resources.fhir_codeable_concept(obj)

Generic function to convert object to FHIR CodeableConcept.

converters.resources.fhir_coding_util(obj)

Genenric function to convert object to FHIR Coding.

converters.resources.gene_to_fhir(obj)

Convert Gene to Observation.component:gene property. GA4GH Phenopackets Implementation Guide provides a link to Genomics Reporting Implementation Guide (STU1) mapping http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/region-studied .

Parameters

obj – gene json

Returns

Observation.component:gene json

converters.resources.hts_file_to_fhir(obj)

Converts HTS file to FHIR DocumentReference.

Parameters

obj – HTS file json

Returns

FHIR DocumentReference json

converters.resources.individual_to_fhir(obj)

Converts Individual to FHIR Patient.

Parameters

obj – Individual json

Returns

FHIR Patient json

converters.resources.phenopacket_to_fhir(obj)

Converts Phenopacket to FHIR Composition.

Parameters

obj – Phenopacket json

Returns

FHIR Composition json

converters.resources.phenotypic_feature_to_fhir(obj)

Converts Phenotypic feature to FHIR Observation.

Parameters

obj – PhenotypicFeature json

Returns

FHIR Observation json

converters.resources.procedure_to_fhir(obj)

Converts Procedure to FHIR Specimen collection.

converters.resources.variant_to_fhir(obj)

Variant corresponds to Observation.component:variant. GA4GH Phenopackets Implementation Guide provides a link to Genomics Reporting Implementation Guide (STU1) mapping http://hl7.org/fhir/uv/genomics-reporting/STU1/variant.html.

Parameters

obj – Variant json

Returns

Observation.component:variant json