1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Library providing acess to the elements defined in the various tables of
//! DICOM part 6. Currently, access to the following tables is provided:
//! * "Registry of DICOM Data Elements"
//! * "Registry of DICOM File Meta Elements"
//! * "Registry of DICOM Directory Structuring Elements"
//! * "Registry of DICOM Unique Identifiers (UIDs)"
//!
//! # Example - Writing data elements to file
//!
//! ```rust,no_run
//! extern crate dicom_dictionary_parser as dict_parser;
//!
//! use std::fs::File;
//! use std::io::BufWriter;
//! use std::io::Write;
//!
//! fn main() -> Result<(), Box<::std::error::Error>> {
//!     let parser = dict_parser::Parser::new()?;
//!     let data_elements = parser.parse_data_element_registry()?;
//!     let file = File::create("dictionary.rs")?;
//!     let mut buf_writer = BufWriter::new(file);
//!     for data_element in data_elements {
//!         let upper_case_keyword = data_element
//!             .keyword
//!             .replace("\u{200b}", "")
//!             .replace("__", "_")
//!             .to_uppercase();
//!
//!         buf_writer.write_all(
//!             format!(
//!                 "const {}: Tag = Tag(0x{}, 0x{});\n",
//!                 upper_case_keyword,
//!                 &data_element.tag[1..5],
//!                 &data_element.tag[6..10])
//!             .as_bytes())?;
//!     }
//!
//!     Ok(())
//! }
//! ```

pub mod data_element;
pub mod parser;
pub mod uid;

pub use data_element::DataElement;
pub use parser::Parser;
pub use uid::{Kind, UID};

extern crate reqwest;
extern crate xmltree;