Ejemplo n.º 1
0
    def extract_patient(json_object):

        field_paths = {
            'patient_id': ['id'],
            'first_name': ['name', 0, 'given', 0],
            'last_name': ['name', 0, 'family'],
            'gender': ['gender'],
            'birth': ['birthDate'],
            'death': ['deceasedDateTime'],
        }

        field_defaults = {
            'death': '3000-01-01T00:00:00+00:00',
        }

        json_object = atg.extract_fields(json_object=json_object,
                                         field_paths=field_paths,
                                         field_defaults=field_defaults)

        json_object['name'] = remove_digits(json_object['first_name'] + ' ' +
                                            json_object['last_name'])

        json_object.pop('first_name')
        json_object.pop('last_name')

        return json_object
Ejemplo n.º 2
0
    def extract_condition_encounter(json_object):

        field_paths = {
            'from': ['id'],
            'to': ['encounter', 'reference'],
        }

        json_object = atg.extract_fields(json_object=json_object,
                                         field_paths=field_paths)

        json_object = {
            'from': json_object['from'],
            'to': json_object['to'].replace('Encounter/', '')
        }

        return json_object
Ejemplo n.º 3
0
    def extract_patient_condition(json_object):

        field_paths = {
            'from': ['id'],
            'to': ['subject', 'reference'],
        }

        json_object = atg.extract_fields(json_object=json_object,
                                         field_paths=field_paths)

        json_object = {
            'from': json_object['from'],
            'to': json_object['to'].replace('Patient/', '')
        }

        return json_object
Ejemplo n.º 4
0
    def extract_encounter_practitioner(json_object):

        field_paths = {
            'from': ['id'],
            'to': ['participant', 0, 'individual', 'reference'],
        }

        json_object = atg.extract_fields(json_object=json_object,
                                         field_paths=field_paths)

        json_object = {
            'from': json_object['from'],
            'to': json_object['to'].replace('Practitioner/', '')
        }

        return json_object
Ejemplo n.º 5
0
    def extract_practitioner(json_object):

        field_paths = {
            'provider_id': ['practitioner', 'reference'],
            'name': ['practitioner', 'display'],
            'specialty': ['specialty', 0, 'text']
        }

        json_object = atg.extract_fields(json_object=json_object,
                                         field_paths=field_paths)

        json_object['provider_id'] = json_object['provider_id'].replace(
            'Practitioner/', '')

        json_object['name'] = remove_digits(json_object['name'])

        return json_object