Beispiel #1
0
    "samp_collect_device": "test",
    "samp_mat_process": "test",
    "samp_size": "test",
    "source_mat_id": ["a", "b", "c"]
}

sample.mixs = mixs_data
sample.visit_number = 2
sample.date = "2000-01-01"
sample.interval = 4
sample.fma_body_site = "head"
sample.clinic_id = "Test clinic ID"
sample.int_sample_id = "test_sample_id"

sample.tags = ["test", "sample", "ihmp"]
sample.add_tag("another")
sample.add_tag("and_another")
sample.links = {"collected_during": ["610a4911a5ca67de12cdc1e4b400f121"]}

print(sample.to_json(indent=2))

if sample.is_valid():
    print("Valid!")

    success = sample.save()

    if success:
        sample_id = sample.id
        print("Successfully saved sample. ID: %s" % sample_id)

        sample2 = Sample.load(sample_id)
Beispiel #2
0
      "rel_to_oxygen": "testest",
      "samp_collect_device": "test",
      "samp_mat_process": "test",
      "samp_size": "test",
      "source_mat_id": [ "a", "b", "c" ]
    }

sample.mixs = mixs_data
sample.visit_number = 2
sample.date = "2000-01-01"
sample.interval = 4
sample.fma_body_site = "head"
sample.clinic_id = "Test clinic ID"

sample.tags = [ "test", "sample", "ihmp" ]
sample.add_tag("another")
sample.add_tag("and_another")
sample.links = { "collected_during": [ "610a4911a5ca67de12cdc1e4b400f121" ] }

print(sample.to_json(indent=2))

if sample.is_valid():
    print("Valid!")

    success = sample.save()

    if success:
        sample_id = sample.id
        print("Successfully saved sample. ID: %s" % sample_id)

        sample2 = Sample.load(sample_id)