From 2258691e05dd76f207de3e2b041cba19191700e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebesty=C3=A9n=20Bal=C3=A1zs?= Date: Thu, 22 Oct 2026 12:40:10 +0300 Subject: [PATCH] apps, docs, fixtures, README: read the fhir leaves and render them Co-authored-by: Astra Co-authored-by: Claude Opus 5.5 --- README.md | 1 + apps/12-fhir-view/Cargo.lock | 128 +++++++ apps/12-fhir-view/Cargo.toml | 15 + apps/12-fhir-view/README.md | 29 ++ apps/12-fhir-view/src/main.rs | 329 ++++++++++++++++++ docs/03-data-paths.md | 48 +++ fixtures/README.md | 7 +- fixtures/no-call/v1/genome/rsids/rs671/fhir | 1 + .../TAS2R38/changes/141972731-141972731/fhir | 1 + .../TAS2R38/changes/141973131-141973131/fhir | 1 + .../TAS2R38/changes/141973571-141973571/fhir | 1 + fixtures/v1/genome/genes/TAS2R38/fhir | 1 + .../UGT2B17/copies/68507494-68624781/fhir | 1 + fixtures/v1/genome/positions/chrM/263/fhir | 1 + .../v1/genome/positions/chrM/263/genotype | 1 + .../v1/genome/positions/chrM/263/reference | 1 + fixtures/v1/genome/rsids/rs671/fhir | 1 + 17 files changed, 565 insertions(+), 2 deletions(-) create mode 100644 apps/12-fhir-view/Cargo.lock create mode 100644 apps/12-fhir-view/Cargo.toml create mode 100644 apps/12-fhir-view/README.md create mode 100644 apps/12-fhir-view/src/main.rs create mode 100644 fixtures/no-call/v1/genome/rsids/rs671/fhir create mode 100644 fixtures/v1/genome/genes/TAS2R38/changes/141972731-141972731/fhir create mode 100644 fixtures/v1/genome/genes/TAS2R38/changes/141973131-141973131/fhir create mode 100644 fixtures/v1/genome/genes/TAS2R38/changes/141973571-141973571/fhir create mode 100644 fixtures/v1/genome/genes/TAS2R38/fhir create mode 100644 fixtures/v1/genome/genes/UGT2B17/copies/68507494-68624781/fhir create mode 100644 fixtures/v1/genome/positions/chrM/263/fhir create mode 100644 fixtures/v1/genome/positions/chrM/263/genotype create mode 100644 fixtures/v1/genome/positions/chrM/263/reference create mode 100644 fixtures/v1/genome/rsids/rs671/fhir diff --git a/README.md b/README.md index 89d1711..d7dc99c 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ and a full app turns the same read into a report. Each row is a folder under | `09-vcf-roll-call` | parsing the whole call file as a report | Rust | | `10-motif-finder` | computing over a gene's reference sequence | Rust | | `11-fortune-cookie` | why the sandbox is deterministic | Rust | +| `12-fhir-view` | genomic FHIR resources as component tables beside their JSON | Rust | ## Documentation diff --git a/apps/12-fhir-view/Cargo.lock b/apps/12-fhir-view/Cargo.lock new file mode 100644 index 0000000..ec66c20 --- /dev/null +++ b/apps/12-fhir-view/Cargo.lock @@ -0,0 +1,128 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "fhir-view" +version = "0.1.0" +dependencies = [ + "serde_json", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "indexmap", + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "syn" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/apps/12-fhir-view/Cargo.toml b/apps/12-fhir-view/Cargo.toml new file mode 100644 index 0000000..17744a8 --- /dev/null +++ b/apps/12-fhir-view/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "fhir-view" +version = "0.1.0" +edition = "2024" + +[dependencies] +serde_json = { version = "1.0", features = ["preserve_order"] } + +# A smaller module uploads and starts faster on an Ark. +[profile.release] +opt-level = "z" +lto = "fat" +codegen-units = 1 +panic = "abort" +strip = "symbols" diff --git a/apps/12-fhir-view/README.md b/apps/12-fhir-view/README.md new file mode 100644 index 0000000..3be32d5 --- /dev/null +++ b/apps/12-fhir-view/README.md @@ -0,0 +1,29 @@ +# FHIR View + +Reads genomic FHIR R4 JSON and renders its codes and components beside the +re-indented leaves. The stored JSON is compact; the display preserves key order +and content. The report counts resources without interpreting traits. + +The app reads a site collection at rs671, the TAS2R38 collection and its change +resources, UGT2B17 copy resources, and a haploid site at chrM position 263. +The two genes and the haploid site are optional grants. +The public dataset directory distinguishes a missing copy number upload from +an empty answer. Public grants cannot be optional. + +```sh +make run APP=12-fhir-view +make run APP=12-fhir-view FIXTURES=fixtures/no-call +make run APP=12-fhir-view FIXTURES=fixtures/unanswered +OPTIONAL=off make run APP=12-fhir-view +``` + +The last command declines the optional grants, leaving only rs671 and the +dataset directory. Ungranted and missing endpoints are reported as absent. +Other read errors stop the app. +The report reads at most three change and three copy endpoints, renders eight +resources per endpoint, and prints at most 12 KiB of each re-indented leaf. +Every cut includes the omitted count. + +The [data path reference](../../docs/03-data-paths.md#fhir) describes the +resource shapes, and the [report guide](../../docs/06-reports.md) describes +the Markdown output. diff --git a/apps/12-fhir-view/src/main.rs b/apps/12-fhir-view/src/main.rs new file mode 100644 index 0000000..232a164 --- /dev/null +++ b/apps/12-fhir-view/src/main.rs @@ -0,0 +1,329 @@ +//! Renders FHIR leaves as component tables beside their re-indented JSON. + +use std::fs::{self, File}; +use std::io::{self, Read}; +use std::path::Path; + +use serde_json::Value; + +/// Largest leaf accepted from the Ark, in bytes. +const MAX_LEAF: usize = 16 * 1024 * 1024; +/// Maximum re-indented JSON bytes printed for one endpoint. +const MAX_RAW: usize = 12 * 1024; +/// Maximum resources rendered per endpoint. +const MAX_RESOURCES: usize = 8; +/// Maximum change or copy endpoints read from one directory. +const MAX_ENTRIES: usize = 3; + +/// Runs the manifest pass or writes the report from granted files. +fn main() { + let Some(dir) = std::env::args().nth(1) else { + print!( + r#"manifest = 1 + +[app] +name = "FHIR View" +version = "0.1.0" + +[reads] +paths = ["v1/genome/rsids/rs671", "v1/genome/datasets"] +optional = ["v1/genome/genes/TAS2R38", "v1/genome/genes/UGT2B17", "v1/genome/positions/chrM/263"] + +[listing] +language = "en" +icon = "🔎" +summary = "Read your genomic FHIR resources as tables beside their original JSON." +category = "developer" +license = "BSD-3-Clause" +source = "https://github.com/dark-bio/examples/tree/main/apps/12-fhir-view" +keywords = ["FHIR", "JSON", "genotype", "copy number"] +description = ''' +See one site, a gene, individual changes, copy numbers and a haploid site as FHIR R4 JSON. Each leaf appears beside a rendered component table. + +Missing answers stay missing. The app counts resources, limits long displays and makes no trait prediction. +''' + +[listing.purposes] +"v1/genome/rsids/rs671" = "A site collection and its exact genotype" +"v1/genome/genes/TAS2R38" = "A gene collection and individual change resources" +"v1/genome/genes/UGT2B17" = "Individual copy number resources" +"v1/genome/positions/chrM/263" = "A haploid site and its variant" +"v1/genome/datasets" = "Whether a copy number dataset is uploaded" +"# + ); + return; + }; + if let Err(error) = report(Path::new(&dir)) { + eprintln!("{error}"); + std::process::exit(1); + } +} + +/// One leaf's path, re-indented JSON and parsed resource. +struct Leaf { + /// Granted path relative to the data root. + path: String, + /// Re-indented JSON with key order preserved, absent when there is no answer. + json: Option, + /// Parsed JSON used for the rendered view. + resource: Option, +} + +impl Leaf { + /// Reads one bounded leaf, treating only not-found as an absent answer. + fn read(root: &Path, path: &str) -> io::Result { + let mut raw = String::new(); + match File::open(root.join(path)) { + Ok(file) => { + file.take(MAX_LEAF as u64 + 1).read_to_string(&mut raw)?; + if raw.len() > MAX_LEAF { + return Err(io::Error::other("FHIR leaf exceeds 16 MiB")); + } + let resource: Value = serde_json::from_str(&raw).map_err(io::Error::other)?; + match resource["resourceType"].as_str() { + Some("Observation" | "Bundle") => {} + _ => return Err(io::Error::other("unrecognized FHIR resource")), + } + let json = serde_json::to_string_pretty(&resource).map_err(io::Error::other)?; + Ok(Self { + path: path.into(), + json: Some(json), + resource: Some(resource), + }) + } + Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(Self { + path: path.into(), + json: None, + resource: None, + }), + Err(error) => Err(error), + } + } + + /// Returns the observations in their stored order. + fn observations(&self) -> Vec<&Value> { + match self.resource.as_ref() { + Some(resource) if resource["resourceType"] == "Bundle" => resource["entry"] + .as_array() + .into_iter() + .flatten() + .map(|entry| &entry["resource"]) + .collect(), + Some(resource) => vec![resource], + None => Vec::new(), + } + } + + /// Prints a bounded rendered view followed by the re-indented leaf. + fn print(&self, number: usize) { + println!("### Endpoint {number}\n\n`{}`\n", self.path); + let Some(json) = &self.json else { + println!("No answer. This leaf is absent.\n"); + return; + }; + let observations = self.observations(); + if observations.is_empty() { + println!("An empty `Bundle` collection.\n"); + } + for observation in observations.iter().take(MAX_RESOURCES) { + println!( + "`Observation {}` = {}\n", + code(&observation["code"]), + inline(&concept(&observation["valueCodeableConcept"])) + ); + let components = observation["component"] + .as_array() + .map(Vec::as_slice) + .unwrap_or(&[]); + if !components.is_empty() { + println!("| Code | Display | Value |\n| :-- | :-- | :-- |"); + for component in components.iter().take(24) { + let display = component["code"]["coding"][0]["display"] + .as_str() + .unwrap_or("Uncoded"); + let value = if let Some(value) = component.get("valueCodeableConcept") { + concept(value) + } else if let Some(value) = component.get("valueString") { + value.as_str().unwrap_or("").to_string() + } else if let Some(value) = component.get("valueQuantity") { + format!("{} copies", value["value"]) + } else if let Some(value) = component.get("valueRange") { + format!("{}-{} bp", value["low"]["value"], value["high"]["value"]) + } else { + "No value".into() + }; + println!( + "| {} | {} | {} |", + inline(&code(&component["code"])), + cell(display), + cell(&value) + ); + } + println!(); + if components.len() > 24 { + println!("{} components omitted.\n", components.len() - 24); + } + } + } + if observations.len() > MAX_RESOURCES { + println!( + "{} resources omitted from the rendered view.\n", + observations.len() - MAX_RESOURCES + ); + } + let mut end = json.len().min(MAX_RAW); + while !json.is_char_boundary(end) { + end -= 1; + } + println!( + "Leaf stored compact; shown re-indented with content unchanged:\n\n```json\n{}\n```\n", + &json[..end] + ); + if end < json.len() { + println!( + "{} bytes omitted from the re-indented JSON.\n", + json.len() - end + ); + } + } +} + +/// Returns the first terminology code or an uncoded label. +fn code(value: &Value) -> String { + value["coding"][0]["code"] + .as_str() + .unwrap_or("uncoded") + .into() +} + +/// Renders a coded concept or preserves its exact text. +fn concept(value: &Value) -> String { + if let Some(text) = value["text"].as_str() { + return text.into(); + } + value["coding"] + .as_array() + .into_iter() + .flatten() + .map(|coding| { + format!( + "{} {}", + coding["code"].as_str().unwrap_or(""), + coding["display"].as_str().unwrap_or("") + ) + }) + .collect::>() + .join(", ") + .trim_end() + .into() +} + +/// Limits long values while preserving the count of omitted characters. +fn shortened(value: &str) -> String { + let count = value.chars().count(); + if count <= 256 { + return value.into(); + } + format!( + "{} ({} characters omitted)", + value.chars().take(256).collect::(), + count - 256 + ) +} + +/// Escapes text for a Markdown table cell. +fn cell(value: &str) -> String { + shortened(value) + .replace('|', "\\|") + .replace(['\n', '\r'], " ") + .replace('`', "'") +} + +/// Keeps exact genotype separators in prose code, outside Markdown tables. +fn inline(value: &str) -> String { + format!("`{}`", shortened(value).replace('`', "'")) +} + +/// Appends a sorted, bounded selection of change or copy leaves. +fn entries(root: &Path, path: &str, paths: &mut Vec) -> io::Result { + let directory = match fs::read_dir(root.join(path)) { + Ok(directory) => directory, + Err(error) if error.kind() == io::ErrorKind::NotFound => return Ok(0), + Err(error) => return Err(error), + }; + let mut names = directory + .map(|entry| { + entry? + .file_name() + .into_string() + .map_err(|_| io::Error::other("entry name is not UTF-8")) + }) + .collect::>>()?; + names.sort(); + for name in names.iter().take(MAX_ENTRIES) { + paths.push(format!("{path}/{name}/fhir")); + } + Ok(names.len().saturating_sub(MAX_ENTRIES)) +} + +/// Reads the five endpoint types and prints the report in evidence order. +fn report(root: &Path) -> io::Result<()> { + let mut paths = vec![ + "v1/genome/rsids/rs671/fhir".into(), + "v1/genome/genes/TAS2R38/fhir".into(), + ]; + let omitted = entries(root, "v1/genome/genes/TAS2R38/changes", &mut paths)? + + entries(root, "v1/genome/genes/UGT2B17/copies", &mut paths)?; + paths.push("v1/genome/positions/chrM/263/fhir".into()); + let copies = match fs::metadata(root.join("v1/genome/datasets/copy-number-variants")) { + Ok(metadata) => metadata.is_dir(), + Err(error) if error.kind() == io::ErrorKind::NotFound => false, + Err(error) => return Err(error), + }; + let leaves = paths + .iter() + .map(|path| Leaf::read(root, path)) + .collect::>>()?; + let observations: usize = leaves.iter().map(|leaf| leaf.observations().len()).sum(); + let answered = leaves.iter().filter(|leaf| leaf.json.is_some()).count(); + println!( + "# Genomic Data in FHIR\n\nRead {observations} `Observation` {} from {answered} answered {} across {} {}. Repeated resources count each time they are read.\n", + if observations == 1 { + "resource" + } else { + "resources" + }, + if answered == 1 { "leaf" } else { "leaves" }, + paths.len(), + if paths.len() == 1 { + "endpoint" + } else { + "endpoints" + } + ); + println!("## Evidence\n"); + for (index, leaf) in leaves.iter().enumerate() { + leaf.print(index + 1); + } + if omitted > 0 { + println!("{omitted} additional change or copy endpoints omitted.\n"); + } + println!( + "{}\n", + if copies { + "A copy number dataset is uploaded. Missing counts remain unanswered." + } else { + "No copy number dataset is uploaded. An empty copy listing is not a reference answer." + } + ); + println!( + "## Method\n\nRead FHIR R4 leaves shaped by HL7 Genomics Reporting STU3. Render their LOINC codes, component values and re-indented JSON without interpreting traits. Genotypes appear exactly as stored in `valueCodeableConcept.text`.\n" + ); + println!( + "## Limitations\n\nThis view samples two genes and two sites. It counts resource instances, not distinct variants. Missing answers never imply reference alleles. Displays are bounded and count omitted content. The leaves contain no dates, `subject` or `specimen`.\n" + ); + println!( + "## Sources\n\n1. HL7 International. Genomics Reporting Implementation Guide, STU3, FHIR R4 4.0.1. https://hl7.org/fhir/uv/genomics-reporting/STU3/\n2. Regenstrief Institute. LOINC. https://loinc.org/" + ); + Ok(()) +} diff --git a/docs/03-data-paths.md b/docs/03-data-paths.md index 392bfe1..1bfacbf 100644 --- a/docs/03-data-paths.md +++ b/docs/03-data-paths.md @@ -31,6 +31,7 @@ v1/genome/ + / + reference genotype + fhir changes/ copies/ genes/ + one gene, by symbol @@ -41,6 +42,7 @@ v1/genome/ + strand biotype reference + fhir changes/ copies/ positions// unlisted, a site inside the gene @@ -49,6 +51,7 @@ v1/genome/ + length -/ + reference + fhir changes/ copies/ positions// unlisted, a site inside the interval @@ -59,6 +62,7 @@ v1/genome/ + end reference genotype + fhir changes/ copies/ datasets/ + which datasets are uploaded @@ -154,6 +158,7 @@ An entry's leaves, each present only when it has a value: - `count`, `evidence` and `event` carry the record's copy number, evidence and event. - `mate`, `mate-id`, `joins` and `mate-joins` describe a breakend's join. +- `fhir` holds the change as a FHIR resource. ## Copies @@ -163,6 +168,49 @@ total copy number over the segment, `failed` lists the filters it failed, and `start-range` and `end-range` give its uncertain edges. A count never says gain or loss by itself, since what is normal depends on the chromosome and the person's sex. `copies/` is empty while no copy number file is uploaded. +Its `fhir` leaf holds the segment as a FHIR resource when `count` has an answer. + +## FHIR + +Each `fhir` leaf is compact FHIR R4 4.0.1 JSON, with media type +`application/fhir+json` and no trailing newline. Its components follow the +[HL7 Genomics Reporting STU3 profiles](https://hl7.org/fhir/uv/genomics-reporting/STU3/). + +| Endpoint | Resource | +| :-- | :-- | +| `changes//fhir` | one Variant `Observation`, LOINC `69548-6` | +| `copies//fhir` | one Variant `Observation` with a copy number component | +| a position or rsID's `fhir` | a `collection` `Bundle` containing a Genotype `Observation`, LOINC `84413-4`, and its variants | +| a gene or interval's `fhir` | a `collection` `Bundle` containing its changes and answered copy numbers | + +Positions inside genes and intervals have the same site leaf. The genotype is +preserved exactly in `valueCodeableConcept.text`. Its `derivedFrom` references +one Variant per distinct non-reference sequence allele. Spanning deletions +(`*`), symbolic alleles and breakends remain in the genotype text but derive no +Variant here. Their full descriptions are in `changes//fhir`. +A fully called reference site instead has one Variant valued `Absent`. +Missing and skipped alleles never imply `Absent`. Missing site answers and +missing copy counts have no `fhir` leaf. Empty span answers have an empty +collection. + +Only known component values are included. Gene symbols are text because the +annotations do not hold HGNC identifiers. Copy counts do not infer gain or +loss. RefSeq accessions are included only for GRCh37 and GRCh38, with chrM +included only for GRCh38. Allelic state is included only for fully called +alternate alleles, never on chrM. Haploid calls carry it only on chrX and chrY. + +The JSON contains no dates, `subject`, `specimen` or `performer`. Resource IDs +and `urn:uuid:` entry URLs use UUIDv5 over canonical paths in the URL namespace. +Site aliases use their `positions///fhir` path. The same data produces +identical JSON. Gene and interval leaves share the 4000000-base and +16384-entry limits; their entry count includes both changes and copies. +Every FHIR leaf also has a 16 MiB JSON limit. Exceeding a limit fails with +"file too large" (EFBIG). The fixture's TAS2R38 change at 141972731 occupies +2,551 bytes. Including collection overhead, about 6,400 changes of that size +fit in one leaf. Longer alleles and additional components reduce that count. + +[12-fhir-view](../apps/12-fhir-view) renders these leaves beside their +re-indented JSON, preserving key order and content. ## Genotypes diff --git a/fixtures/README.md b/fixtures/README.md index d0cf2f9..8a67f64 100644 --- a/fixtures/README.md +++ b/fixtures/README.md @@ -11,8 +11,8 @@ coordinates, reference alleles and sequences are public data. | Root | Used by | What it models | | :-- | :-- | :-- | | `fixtures` | every app | typical calls, including phased, haploid and reference calls, no copies of UGT2B17, and the ACE insertion on both copies | -| `fixtures/no-call` | the rsID, copy number and structural apps | a no-call, `./.`, at every panel variant, a copy number segment without a count, and the ACE insertion with a copy uncalled | -| `fixtures/unanswered` | the rsID apps | no genotypes at the panel variants, as at reference sites in a variants-only call file, and no copy number or structural variant upload, so the `07` and `08` apps never start | +| `fixtures/no-call` | the rsID, copy number and structural apps, and `12-fhir-view` | a no-call, `./.`, at every panel variant, a copy number segment without a count, and the ACE insertion with a copy uncalled | +| `fixtures/unanswered` | the rsID apps and `12-fhir-view` | no genotypes at the panel variants, as at reference sites in a variants-only call file, and no copy number or structural variant upload, so the `07` and `08` apps never start | The rsID apps are `02-permissions`, the cilantro apps and `11-fortune-cookie`, the copy number apps are the `07` ones, and the structural apps the `08` ones. @@ -45,6 +45,9 @@ Keep every file exactly as an Ark would serve it. have no `reference`. - `files/small-variants/vcf` is ordinary VCF text and keeps its newlines. Keep it in agreement with the files beside it. +- The `fhir` leaves used by `12-fhir-view` match what an Ark serves, byte for + byte. Keep their bytes unchanged. A missing genotype or copy count has no + corresponding site or copy resource. ## Sources diff --git a/fixtures/no-call/v1/genome/rsids/rs671/fhir b/fixtures/no-call/v1/genome/rsids/rs671/fhir new file mode 100644 index 0000000..5d95da4 --- /dev/null +++ b/fixtures/no-call/v1/genome/rsids/rs671/fhir @@ -0,0 +1 @@ +{"resourceType":"Bundle","id":"8a5906e3-e2a9-5a3f-b290-158763533fd9","type":"collection","entry":[{"fullUrl":"urn:uuid:877ae6ef-4214-5a53-b616-34ac9b908eee","resource":{"resourceType":"Observation","id":"877ae6ef-4214-5a53-b616-34ac9b908eee","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genotype"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"84413-4","display":"Genotype display name"}]},"valueCodeableConcept":{"text":"./."},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000012.12"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":111803962},"high":{"value":111803962}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}}]}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/genes/TAS2R38/changes/141972731-141972731/fhir b/fixtures/v1/genome/genes/TAS2R38/changes/141972731-141972731/fhir new file mode 100644 index 0000000..9f55adc --- /dev/null +++ b/fixtures/v1/genome/genes/TAS2R38/changes/141972731-141972731/fhir @@ -0,0 +1 @@ +{"resourceType":"Observation","id":"49a79358-2fe6-51d1-87b0-eebf44af9f57","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000007.14"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":141972731},"high":{"value":141972731}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"TAS2R38"}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"T"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"C"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6706-1","display":"Heterozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/genes/TAS2R38/changes/141973131-141973131/fhir b/fixtures/v1/genome/genes/TAS2R38/changes/141973131-141973131/fhir new file mode 100644 index 0000000..c12219f --- /dev/null +++ b/fixtures/v1/genome/genes/TAS2R38/changes/141973131-141973131/fhir @@ -0,0 +1 @@ +{"resourceType":"Observation","id":"a52dd5e1-3798-5fd5-9da6-1b52fa18068d","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000007.14"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":141973131},"high":{"value":141973131}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"TAS2R38"}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"T"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"G"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6705-3","display":"Homozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/genes/TAS2R38/changes/141973571-141973571/fhir b/fixtures/v1/genome/genes/TAS2R38/changes/141973571-141973571/fhir new file mode 100644 index 0000000..87d305e --- /dev/null +++ b/fixtures/v1/genome/genes/TAS2R38/changes/141973571-141973571/fhir @@ -0,0 +1 @@ +{"resourceType":"Observation","id":"5e0fa34b-3a84-57e7-9466-60742c8e0a47","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000007.14"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":141973571},"high":{"value":141973571}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"TAS2R38"}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"T"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"C"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6706-1","display":"Heterozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/genes/TAS2R38/fhir b/fixtures/v1/genome/genes/TAS2R38/fhir new file mode 100644 index 0000000..5753977 --- /dev/null +++ b/fixtures/v1/genome/genes/TAS2R38/fhir @@ -0,0 +1 @@ +{"resourceType":"Bundle","id":"e75dd10b-be5b-5d44-b6f0-ff81ae011ed8","type":"collection","entry":[{"fullUrl":"urn:uuid:49a79358-2fe6-51d1-87b0-eebf44af9f57","resource":{"resourceType":"Observation","id":"49a79358-2fe6-51d1-87b0-eebf44af9f57","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000007.14"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":141972731},"high":{"value":141972731}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"TAS2R38"}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"T"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"C"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6706-1","display":"Heterozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]}},{"fullUrl":"urn:uuid:a52dd5e1-3798-5fd5-9da6-1b52fa18068d","resource":{"resourceType":"Observation","id":"a52dd5e1-3798-5fd5-9da6-1b52fa18068d","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000007.14"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":141973131},"high":{"value":141973131}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"TAS2R38"}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"T"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"G"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6705-3","display":"Homozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]}},{"fullUrl":"urn:uuid:5e0fa34b-3a84-57e7-9466-60742c8e0a47","resource":{"resourceType":"Observation","id":"5e0fa34b-3a84-57e7-9466-60742c8e0a47","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000007.14"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":141973571},"high":{"value":141973571}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"TAS2R38"}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"T"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"C"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6706-1","display":"Heterozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/genes/UGT2B17/copies/68507494-68624781/fhir b/fixtures/v1/genome/genes/UGT2B17/copies/68507494-68624781/fhir new file mode 100644 index 0000000..e543fb3 --- /dev/null +++ b/fixtures/v1/genome/genes/UGT2B17/copies/68507494-68624781/fhir @@ -0,0 +1 @@ +{"resourceType":"Observation","id":"aa5532fa-03b3-54e0-91ad-0406686b7b47","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000004.12"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":68507494},"high":{"value":68624781}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48018-6","display":"Gene studied [ID]"}]},"valueCodeableConcept":{"text":"UGT2B17"}},{"code":{"coding":[{"system":"http://loinc.org","code":"82155-3","display":"Genomic structural variant copy number"}]},"valueQuantity":{"value":0,"system":"http://unitsofmeasure.org","code":"1"}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/positions/chrM/263/fhir b/fixtures/v1/genome/positions/chrM/263/fhir new file mode 100644 index 0000000..d5f2b96 --- /dev/null +++ b/fixtures/v1/genome/positions/chrM/263/fhir @@ -0,0 +1 @@ +{"resourceType":"Bundle","id":"bdbd4722-d16a-5acd-ab8e-0d922a9fd2c7","type":"collection","entry":[{"fullUrl":"urn:uuid:e513764e-cee4-5598-8756-3e57d00cb58e","resource":{"resourceType":"Observation","id":"e513764e-cee4-5598-8756-3e57d00cb58e","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genotype"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"84413-4","display":"Genotype display name"}]},"valueCodeableConcept":{"text":"G"},"derivedFrom":[{"reference":"urn:uuid:2245ae13-6e2e-5f05-bf36-241d0bab2b29"}],"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_012920.1"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":263},"high":{"value":263}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}}]}},{"fullUrl":"urn:uuid:2245ae13-6e2e-5f05-bf36-241d0bab2b29","resource":{"resourceType":"Observation","id":"2245ae13-6e2e-5f05-bf36-241d0bab2b29","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_012920.1"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":263},"high":{"value":263}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"A"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"G"},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]}}]} \ No newline at end of file diff --git a/fixtures/v1/genome/positions/chrM/263/genotype b/fixtures/v1/genome/positions/chrM/263/genotype new file mode 100644 index 0000000..4fc3fe1 --- /dev/null +++ b/fixtures/v1/genome/positions/chrM/263/genotype @@ -0,0 +1 @@ +G \ No newline at end of file diff --git a/fixtures/v1/genome/positions/chrM/263/reference b/fixtures/v1/genome/positions/chrM/263/reference new file mode 100644 index 0000000..8c7e5a6 --- /dev/null +++ b/fixtures/v1/genome/positions/chrM/263/reference @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/fixtures/v1/genome/rsids/rs671/fhir b/fixtures/v1/genome/rsids/rs671/fhir new file mode 100644 index 0000000..a0b8d3e --- /dev/null +++ b/fixtures/v1/genome/rsids/rs671/fhir @@ -0,0 +1 @@ +{"resourceType":"Bundle","id":"8a5906e3-e2a9-5a3f-b290-158763533fd9","type":"collection","entry":[{"fullUrl":"urn:uuid:877ae6ef-4214-5a53-b616-34ac9b908eee","resource":{"resourceType":"Observation","id":"877ae6ef-4214-5a53-b616-34ac9b908eee","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genotype"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"84413-4","display":"Genotype display name"}]},"valueCodeableConcept":{"text":"A/A"},"derivedFrom":[{"reference":"urn:uuid:184962c4-bde4-5c14-bac7-2a860c0d101f"}],"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000012.12"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":111803962},"high":{"value":111803962}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}}]}},{"fullUrl":"urn:uuid:184962c4-bde4-5c14-bac7-2a860c0d101f","resource":{"resourceType":"Observation","id":"184962c4-bde4-5c14-bac7-2a860c0d101f","meta":{"profile":["http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"]},"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory","display":"Laboratory"}]},{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"GE","display":"Genetics"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"69548-6","display":"Genetic variant assessment"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA9633-4","display":"Present"}]},"component":[{"code":{"coding":[{"system":"http://loinc.org","code":"62374-4","display":"Human reference sequence assembly version"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA26806-2","display":"GRCh38"}],"text":"GRCh38.p14"}},{"code":{"coding":[{"system":"http://loinc.org","code":"48013-7","display":"Genomic reference sequence [ID]"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.ncbi.nlm.nih.gov/refseq","code":"NC_000012.12"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"92822-6","display":"Genomic coordinate system [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA30102-0","display":"1-based character counting"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"81254-5","display":"Genomic allele start-end"}]},"valueRange":{"low":{"value":111803962},"high":{"value":111803962}}},{"code":{"coding":[{"system":"http://loinc.org","code":"48002-0","display":"Genomic source class [Type]"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6683-2","display":"Germline"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"69547-8","display":"Genomic ref allele [ID]"}]},"valueString":"G"},{"code":{"coding":[{"system":"http://loinc.org","code":"69551-0","display":"Genomic alt allele [ID]"}]},"valueString":"A"},{"code":{"coding":[{"system":"http://loinc.org","code":"53034-5","display":"Allelic state"}]},"valueCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"LA6705-3","display":"Homozygous"}]}},{"code":{"coding":[{"system":"http://loinc.org","code":"48019-4","display":"DNA change type"}]},"valueCodeableConcept":{"coding":[{"system":"http://www.sequenceontology.org","code":"SO:0001483","display":"SNV"}]}}]}}]} \ No newline at end of file