stdlib/medicalView source ↗
medical
42 items · generated by scribe fromstdlib/medical.fd· synced 2026-11-15
Contents
- HL7_ADT_A01: (const)
- HL7_ADT_A02: (const)
- HL7_ADT_A03: (const)
- HL7_ADT_A04: (const)
- HL7_ADT_A08: (const)
- HL7_ORU_R01: (const)
- HL7_OUL_R22: (const)
- HL7_MDM_T02: (const)
- hl7_msg_type_code (function)
- hl7_msg_type_name (function)
- HL7Message (struct)
- hl7_new (function)
- hl7_set_receiver (function)
- hl7_add_segment (function)
- hl7_segment_count (function)
- hl7_msh_segment (function)
- hl7_pid_segment (function)
- hl7_pv1_segment (function)
- hl7_obx_segment (function)
- hl7_adt_a01 (function)
- hl7_adt_a03 (function)
- hl7_serialize (function)
- hl7_parse (function)
- hl7_get_field (function)
- hl7_segment_type (function)
- FHIR_PATIENT: (const)
- fhir_resource_name (function)
- icd10_validate (function)
- LOINC_GLUCOSE: (const)
- LOINC_HEMOGLOBIN_A1C: (const)
- LOINC_CHOLESTEROL: (const)
- LOINC_CREATININE: (const)
- LOINC_WBC: (const)
- LOINC_RBC: (const)
- LOINC_PLATELETS: (const)
- LOINC_SODIUM: (const)
- LOINC_POTASSIUM: (const)
- LOINC_TEMPERATURE: (const)
- LOINC_HEART_RATE: (const)
- LOINC_BP_SYSTOLIC: (const)
- LOINC_BP_DIASTOLIC: (const)
- LOINC_SPO2: (const)
HL7_ADT_A01:
pub const HL7_ADT_A01: i64 = 1; // Admit a patientDefined at line 18
HL7_ADT_A02:
pub const HL7_ADT_A02: i64 = 2; // Transfer a patientDefined at line 19
HL7_ADT_A03:
pub const HL7_ADT_A03: i64 = 3; // Discharge a patientDefined at line 20
HL7_ADT_A04:
pub const HL7_ADT_A04: i64 = 4; // Register a patientDefined at line 21
HL7_ADT_A08:
pub const HL7_ADT_A08: i64 = 8; // Update patient informationDefined at line 22
HL7_ORU_R01:
pub const HL7_ORU_R01: i64 = 10; // Observation resultDefined at line 23
HL7_OUL_R22:
pub const HL7_OUL_R22: i64 = 11; // Unsolicited lab observationDefined at line 24
HL7_MDM_T02:
pub const HL7_MDM_T02: i64 = 12; // Medical document notificationDefined at line 25
hl7_msg_type_code
Get HL7 message type code.
pub fn hl7_msg_type_code(msg_type: i64) -> str {Parameters:
msg_type:i64
Returns: str
Defined at line 28
hl7_msg_type_name
Get HL7 message type name.
pub fn hl7_msg_type_name(msg_type: i64) -> str {Parameters:
msg_type:i64
Returns: str
Defined at line 57
HL7Message
An HL7 v2 message (pipe-delimited segments).
pub struct HL7Message {Fields:
| Name | Type |
|---|---|
msg_type | i64 |
msg_id | str |
sending_app | str |
sending_facility | str |
receiving_app | str |
receiving_facility | str |
timestamp | str |
segments | Vec<str> |
Defined at line 88
hl7_new
Create a new HL7 message.
pub fn hl7_new(msg_type: i64, msg_id: str, sending_app: str, sending_facility: str, timestamp: str) -> HL7Message {Parameters:
msg_type:i64msg_id:strsending_app:strsending_facility:strtimestamp:str
Returns: HL7Message
Defined at line 101
hl7_set_receiver
Set receiving application and facility.
pub fn hl7_set_receiver(msg: & mut HL7Message, app: str, facility: str) -> void {Parameters:
msg:& mut HL7Messageapp:strfacility:str
Returns: void
Defined at line 108
hl7_add_segment
Add a segment to the message.
pub fn hl7_add_segment(msg: & mut HL7Message, segment: str) -> void {Parameters:
msg:& mut HL7Messagesegment:str
Returns: void
Defined at line 114
hl7_segment_count
Get segment count.
pub fn hl7_segment_count(msg: HL7Message) -> i64 {Parameters:
msg:HL7Message
Returns: i64
Defined at line 119
hl7_msh_segment
Build MSH (Message Header) segment.
pub fn hl7_msh_segment(msg: HL7Message) -> str {Parameters:
msg:HL7Message
Returns: str
Defined at line 126
hl7_pid_segment
Build PID (Patient Identification) segment.
pub fn hl7_pid_segment(patient_id: str, patient_name: str, dob: str, gender: str) -> str {Parameters:
patient_id:strpatient_name:strdob:strgender:str
Returns: str
Defined at line 132
hl7_pv1_segment
Build PV1 (Patient Visit) segment.
pub fn hl7_pv1_segment(patient_class: str, assigned_location: str, attending_doctor: str) -> str {Parameters:
patient_class:strassigned_location:strattending_doctor:str
Returns: str
Defined at line 138
hl7_obx_segment
Build OBX (Observation Result) segment.
pub fn hl7_obx_segment(set_id: i64, value_type: str, observation_id: str, observation_value: str, units: str) -> str {Parameters:
set_id:i64value_type:strobservation_id:strobservation_value:strunits:str
Returns: str
Defined at line 144
hl7_adt_a01
Build an ADT^A01 (Admit Patient) message.
pub fn hl7_adt_a01(sending_facility: str, patient_id: str, patient_name: str, dob: str, gender: str) -> HL7Message {Parameters:
sending_facility:strpatient_id:strpatient_name:strdob:strgender:str
Returns: HL7Message
Defined at line 152
hl7_adt_a03
Build an ADT^A03 (Discharge Patient) message.
pub fn hl7_adt_a03(sending_facility: str, patient_id: str) -> HL7Message {Parameters:
sending_facility:strpatient_id:str
Returns: HL7Message
Defined at line 167
hl7_serialize
Serialize an HL7 message to text (pipe-delimited, newline-separated).
pub fn hl7_serialize(msg: HL7Message) -> str {Parameters:
msg:HL7Message
Returns: str
Defined at line 180
hl7_parse
Parse an HL7 message from text. Returns an HL7Message. Segments are split by CR or LF.
pub fn hl7_parse(text: str) -> HL7Message {Parameters:
text:str
Returns: HL7Message
Defined at line 196
hl7_get_field
Extract a field from a segment (pipe-separated).
pub fn hl7_get_field(segment: str, field_num: i64) -> str {Parameters:
segment:strfield_num:i64
Returns: str
Defined at line 230
hl7_segment_type
Get the segment type (first 3 characters).
pub fn hl7_segment_type(segment: str) -> str {Parameters:
segment:str
Returns: str
Defined at line 239
FHIR_PATIENT:
pub const FHIR_PATIENT: i64 = 0; pub const FHIR_OBSERVATION: i64 = 1; pub const FHIR_CONDITION: i64 = 2; pub const FHIR_MEDICATION: i64 = 3; pub const FHIR_ENCOUNTER: i64 = 4; pub const FHIR_PRACTITIONER: i64 = 5;Defined at line 245
fhir_resource_name
Get FHIR resource type name.
pub fn fhir_resource_name(resource_type: i64) -> str {Parameters:
resource_type:i64
Returns: str
Defined at line 247
icd10_validate
Validate ICD-10 code format (e.g. “E11.9”, “I10”, “J45.909”).
pub fn icd10_validate(code: str) -> bool {Parameters:
code:str
Returns: bool
Defined at line 272
LOINC_GLUCOSE:
pub const LOINC_GLUCOSE: str = "2339-0"; // GlucoseDefined at line 293
LOINC_HEMOGLOBIN_A1C:
pub const LOINC_HEMOGLOBIN_A1C: str = "4548-4"; // HbA1cDefined at line 294
LOINC_CHOLESTEROL:
pub const LOINC_CHOLESTEROL: str = "2093-3"; // CholesterolDefined at line 295
LOINC_CREATININE:
pub const LOINC_CREATININE: str = "2160-0"; // CreatinineDefined at line 296
LOINC_WBC:
pub const LOINC_WBC: str = "6690-2"; // White Blood CellDefined at line 297
LOINC_RBC:
pub const LOINC_RBC: str = "789-8"; // Red Blood CellDefined at line 298
LOINC_PLATELETS:
pub const LOINC_PLATELETS: str = "777-3"; // PlateletsDefined at line 299
LOINC_SODIUM:
pub const LOINC_SODIUM: str = "2951-2"; // SodiumDefined at line 300
LOINC_POTASSIUM:
pub const LOINC_POTASSIUM: str = "2823-3"; // PotassiumDefined at line 301
LOINC_TEMPERATURE:
pub const LOINC_TEMPERATURE: str = "8310-5"; // Body TemperatureDefined at line 302
LOINC_HEART_RATE:
pub const LOINC_HEART_RATE: str = "8867-4"; // Heart RateDefined at line 303
LOINC_BP_SYSTOLIC:
pub const LOINC_BP_SYSTOLIC: str = "8480-6"; // BP SystolicDefined at line 304
LOINC_BP_DIASTOLIC:
pub const LOINC_BP_DIASTOLIC: str = "8462-4"; // BP DiastolicDefined at line 305
LOINC_SPO2:
pub const LOINC_SPO2: str = "59408-5"; // Oxygen SaturationDefined at line 306
Generated by scribe, the Fides documentation generator