예제 #1
0
def hospital_users_migrate(data):
    query = '''
    mutation MyMutation($objects: [hospital_users_insert_input!]!) {
    insert_hospital_users(objects: $objects, on_conflict: {constraint: hospital_users_pkey, update_columns: name}) {
            affected_rows
        }
    }'''

    response = hasura(query=query, variables={'objects': data})
    print('inserted facility medstaff: {}'.format(
        response['data']['insert_hospital_users']['affected_rows']))
예제 #2
0
def patient_history_migrate(data):
    query = '''
    mutation MyMutation($objects: [patient_history_insert_input!]!) {
        insert_patient_history(objects: $objects, on_conflict: {constraint: patient_history_pkey, update_columns: id}) {
            affected_rows
        }
    }'''

    response = hasura(query=query, variables={'objects': data})
    print('inserted patient history: {}'.format(
        response['data']['insert_patient_history']['affected_rows']))
예제 #3
0
def ward_migrate(data):
    query = '''
    mutation MyMutation($objects: [ward_insert_input!]!) {
        insert_ward(objects: $objects, on_conflict: {constraint: ward_pkey, update_columns: id}) {
            affected_rows
        }
    }'''

    response = hasura(query=query, variables={'objects': data})
    print('inserted ward: {}'.format(
        response['data']['insert_ward']['affected_rows']))
def facility_checklist_migrate(data):
    query = '''
    mutation MyMutation($objects: [facility_checklist_insert_input!]!) {
        insert_facility_checklist(objects: $objects, on_conflict: {constraint: facility_checklist_pkey, update_columns: data}) {
            affected_rows
        }
    }'''

    response = hasura(query=query, variables={'objects': data})
    print('inserted facility checklist: {}'.format(
        response['data']['insert_facility_checklist']['affected_rows']))
예제 #5
0
def area_migrate(data):
    query = '''
    mutation MyMutation($objects: [area_insert_input!]!) {
        insert_area(objects: $objects, on_conflict: {constraint: area_pkey, update_columns: value}) {
            affected_rows
        }
    }'''

    response = hasura(query=query, variables={'objects': data})
    print('inserted area: {}'.format(
        response['data']['insert_area']['affected_rows']))
def facility_mapping_through_table_migrate(data):
    query = '''
    mutation MyMutation($objects: [facility_mapping_though_table_insert_input!]!) {
        insert_facility_mapping_though_table(objects: $objects, on_conflict: {constraint: facility_mapping_though_table_pkey, update_columns: [mapped_facility, source_facility]}) {
            affected_rows
        }
    }'''

    response = hasura(query=query, variables={'objects': data})
    print('inserted facility mapping_through_table: {}'.format(
        response['data']['insert_facility_mapping_though_table']
        ['affected_rows']))