| Crates.io | wellally |
| lib.rs | wellally |
| version | 0.0.1 |
| created_at | 2025-12-18 07:14:33.751644+00 |
| updated_at | 2025-12-18 07:14:33.751644+00 |
| description | Health data models for WellAlly platform |
| homepage | https://www.wellally.tech/ |
| repository | https://github.com/huifer/wellally-schemas |
| max_upload_size | |
| id | 1991872 |
| size | 46,046 |
Rust data models for the WellAlly health data platform.
Website: https://www.wellally.tech/
Add this to your Cargo.toml:
[dependencies]
wellally = "0.1.0"
use wellally::{LabReport, LabResult, CodeableConcept, Coding, Quantity, LabValue};
use chrono::Utc;
// Create a lab result
let result = LabResult {
code: CodeableConcept {
coding: vec![Coding {
system: "http://loinc.org".to_string(),
code: "2339-0".to_string(),
display: Some("Glucose".to_string()),
}],
text: None,
},
value: LabValue::Quantity(Quantity {
value: 95.0,
unit: "mg/dL".to_string(),
}),
reference_range: None,
interpretation: Some(wellally::Interpretation::N),
method: None,
};
// Create a lab report
let report = LabReport {
id: "lab-001".to_string(),
patient_id: "patient-123".to_string(),
issued_at: Utc::now(),
results: vec![result],
facility: None,
panel: None,
specimen: None,
};
// Serialize to JSON
let json = serde_json::to_string_pretty(&report).unwrap();
println!("{}", json);
use wellally::{Person, HumanName};
use chrono::NaiveDate;
let person = Person {
id: "patient-123".to_string(),
resource_type: "Person".to_string(),
name: vec![HumanName {
family: "Zhang".to_string(),
given: vec!["San".to_string()],
r#use: None,
prefix: None,
suffix: None,
}],
birth_date: NaiveDate::from_ymd_opt(1990, 1, 1).unwrap(),
gender: Some(wellally::Gender::Male),
..Default::default()
};
use wellally::{MedicationRecord, Dosage, Coding, Route};
use chrono::NaiveDate;
let medication = MedicationRecord {
id: "med-001".to_string(),
patient_id: "patient-123".to_string(),
medication: Coding {
system: "http://www.nlm.nih.gov/research/umls/rxnorm".to_string(),
code: "617310".to_string(),
display: Some("Atorvastatin 20mg".to_string()),
},
dosage: Dosage {
value: 20.0,
unit: "mg".to_string(),
},
route: Route {
system: "http://snomed.info/sct".to_string(),
code: "PO".to_string(),
display: Some("Oral".to_string()),
},
start_date: NaiveDate::from_ymd_opt(2024, 1, 1).unwrap(),
form: None,
frequency: Some("QD".to_string()),
duration_days: None,
end_date: None,
indication: None,
instructions: None,
};
Coding: Coded value from a terminology systemCodeableConcept: Concept with multiple codesQuantity: Measured value with UCUM unitHumanName: Structured person nameContactPoint: Contact informationAddress: Postal addressLabReport: Laboratory test reportImagingReport: Diagnostic imaging reportMedicationRecord: Medication administration recordPerson: Personal health recordFamilyHealthTree: Family health treeThis crate implements data models based on:
MIT License - see LICENSE file for details