#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Use {
Required,
Recommended,
Optional,
Backward,
}
#[derive(Debug, Clone, Copy)]
pub struct FieldSpec {
pub seq: usize,
pub name: &'static str,
pub dt: &'static str,
pub usage: Use,
pub table: Option<&'static str>,
pub repeats: bool,
}
macro_rules! fld {
($seq:expr, $name:expr, $dt:expr, $usage:expr) => {
FieldSpec {
seq: $seq,
name: $name,
dt: $dt,
usage: $usage,
table: None,
repeats: false,
}
};
($seq:expr, $name:expr, $dt:expr, $usage:expr, rep) => {
FieldSpec {
seq: $seq,
name: $name,
dt: $dt,
usage: $usage,
table: None,
repeats: true,
}
};
($seq:expr, $name:expr, $dt:expr, $usage:expr, t $tbl:expr) => {
FieldSpec {
seq: $seq,
name: $name,
dt: $dt,
usage: $usage,
table: Some($tbl),
repeats: false,
}
};
($seq:expr, $name:expr, $dt:expr, $usage:expr, t $tbl:expr, rep) => {
FieldSpec {
seq: $seq,
name: $name,
dt: $dt,
usage: $usage,
table: Some($tbl),
repeats: true,
}
};
}
use Use::{Backward as B, Optional as O, Recommended as RE, Required as R};
#[derive(Debug, Clone, Copy)]
pub struct SegmentSpec {
pub name: &'static str,
pub desc: &'static str,
pub fields: &'static [FieldSpec],
}
const MSH: &[FieldSpec] = &[
fld!(1, "Field Separator", "ST", R),
fld!(2, "Encoding Characters", "ST", R),
fld!(3, "Sending Application", "HD", RE),
fld!(4, "Sending Facility", "HD", RE),
fld!(5, "Receiving Application", "HD", RE),
fld!(6, "Receiving Facility", "HD", RE),
fld!(7, "Date/Time of Message", "DTM", R),
fld!(8, "Security", "ST", O),
fld!(9, "Message Type", "MSG", R),
fld!(10, "Message Control ID", "ST", R),
fld!(11, "Processing ID", "PT", R, t "0103"),
fld!(12, "Version ID", "VID", R, t "0104"),
fld!(13, "Sequence Number", "NM", O),
fld!(14, "Continuation Pointer", "ST", O),
fld!(15, "Accept Ack Type", "ID", O, t "0155"),
fld!(16, "Application Ack Type", "ID", O, t "0155"),
fld!(17, "Country Code", "ID", O),
fld!(18, "Character Set", "ID", O, t "0211", rep),
fld!(19, "Principal Language", "CE", O),
fld!(20, "Alt Character Set Handling", "ID", O, t "0356"),
fld!(21, "Message Profile Identifier", "EI", O, rep),
];
const MSA: &[FieldSpec] = &[
fld!(1, "Acknowledgment Code", "ID", R, t "0008"),
fld!(2, "Message Control ID", "ST", R),
fld!(3, "Text Message", "ST", B),
fld!(4, "Expected Sequence Number", "NM", O),
fld!(5, "Delayed Ack Type", "ID", B),
fld!(6, "Error Condition", "CE", B),
];
const ERR: &[FieldSpec] = &[
fld!(1, "Error Code and Location", "ELD", B, rep),
fld!(2, "Error Location", "ERL", O, rep),
fld!(3, "HL7 Error Code", "CWE", R, t "0357"),
fld!(4, "Severity", "ID", R, t "0516"),
fld!(5, "Application Error Code", "CWE", O),
fld!(7, "Diagnostic Information", "TX", O),
fld!(8, "User Message", "TX", O),
];
const EVN: &[FieldSpec] = &[
fld!(1, "Event Type Code", "ID", B, t "0003"),
fld!(2, "Recorded Date/Time", "DTM", R),
fld!(3, "Date/Time Planned Event", "DTM", O),
fld!(4, "Event Reason Code", "IS", O, t "0062"),
fld!(5, "Operator ID", "XCN", O, rep),
fld!(6, "Event Occurred", "DTM", RE),
fld!(7, "Event Facility", "HD", O),
];
const PID: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Patient ID", "CX", B),
fld!(3, "Patient Identifier List", "CX", R, rep),
fld!(4, "Alternate Patient ID", "CX", B, rep),
fld!(5, "Patient Name", "XPN", R, rep),
fld!(6, "Mother's Maiden Name", "XPN", O, rep),
fld!(7, "Date/Time of Birth", "DTM", RE),
fld!(8, "Administrative Sex", "IS", RE, t "0001"),
fld!(9, "Patient Alias", "XPN", B, rep),
fld!(10, "Race", "CE", O, t "0005", rep),
fld!(11, "Patient Address", "XAD", RE, rep),
fld!(12, "County Code", "IS", B),
fld!(13, "Home Phone Number", "XTN", O, rep),
fld!(14, "Business Phone Number", "XTN", O, rep),
fld!(15, "Primary Language", "CE", O),
fld!(16, "Marital Status", "CE", O, t "0002"),
fld!(17, "Religion", "CE", O, t "0006"),
fld!(18, "Patient Account Number", "CX", O),
fld!(19, "SSN Number", "ST", B),
fld!(20, "Driver's License Number", "DLN", B),
fld!(21, "Mother's Identifier", "CX", O, rep),
fld!(22, "Ethnic Group", "CE", O, t "0189", rep),
fld!(23, "Birth Place", "ST", O),
fld!(24, "Multiple Birth Indicator", "ID", O, t "0136"),
fld!(25, "Birth Order", "NM", O),
fld!(26, "Citizenship", "CE", O, rep),
fld!(27, "Veterans Military Status", "CE", O),
fld!(28, "Nationality", "CE", B),
fld!(29, "Patient Death Date/Time", "DTM", O),
fld!(30, "Patient Death Indicator", "ID", O, t "0136"),
fld!(31, "Identity Unknown Indicator", "ID", O, t "0136"),
fld!(32, "Identity Reliability Code", "IS", O, t "0445", rep),
fld!(33, "Last Update Date/Time", "DTM", O),
fld!(34, "Last Update Facility", "HD", O),
fld!(35, "Species Code", "CE", O),
fld!(36, "Breed Code", "CE", O),
fld!(37, "Strain", "ST", O),
fld!(38, "Production Class Code", "CE", O, t "0429", rep),
fld!(39, "Tribal Citizenship", "CWE", O, rep),
];
const PD1: &[FieldSpec] = &[
fld!(1, "Living Dependency", "IS", O, t "0223", rep),
fld!(2, "Living Arrangement", "IS", O, t "0220"),
fld!(3, "Patient Primary Facility", "XON", O, rep),
fld!(4, "Patient Primary Care Provider", "XCN", B, rep),
fld!(6, "Organ Donor Code", "IS", O),
fld!(11, "Publicity Code", "CE", O, t "0215"),
fld!(12, "Protection Indicator", "ID", O, t "0136"),
];
const NK1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Name", "XPN", RE, rep),
fld!(3, "Relationship", "CE", RE, t "0063"),
fld!(4, "Address", "XAD", O, rep),
fld!(5, "Phone Number", "XTN", O, rep),
fld!(6, "Business Phone Number", "XTN", O, rep),
fld!(7, "Contact Role", "CE", O, t "0131"),
fld!(8, "Start Date", "DT", O),
fld!(9, "End Date", "DT", O),
fld!(13, "Organization Name", "XON", O, rep),
];
const PV1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Patient Class", "IS", R, t "0004"),
fld!(3, "Assigned Patient Location", "PL", RE),
fld!(4, "Admission Type", "IS", O, t "0007"),
fld!(5, "Preadmit Number", "CX", O),
fld!(6, "Prior Patient Location", "PL", O),
fld!(7, "Attending Doctor", "XCN", RE, rep),
fld!(8, "Referring Doctor", "XCN", O, rep),
fld!(9, "Consulting Doctor", "XCN", B, rep),
fld!(10, "Hospital Service", "IS", O, t "0069"),
fld!(11, "Temporary Location", "PL", O),
fld!(12, "Preadmit Test Indicator", "IS", O),
fld!(13, "Readmission Indicator", "IS", O, t "0092"),
fld!(14, "Admit Source", "IS", O),
fld!(15, "Ambulatory Status", "IS", O, t "0009", rep),
fld!(16, "VIP Indicator", "IS", O),
fld!(17, "Admitting Doctor", "XCN", O, rep),
fld!(18, "Patient Type", "IS", O),
fld!(19, "Visit Number", "CX", RE),
fld!(20, "Financial Class", "FC", O, rep),
fld!(21, "Charge Price Indicator", "IS", O),
fld!(36, "Discharge Disposition", "IS", O, t "0112"),
fld!(37, "Discharged to Location", "DLD", O),
fld!(38, "Diet Type", "CE", O),
fld!(39, "Servicing Facility", "IS", O),
fld!(41, "Account Status", "IS", O),
fld!(44, "Admit Date/Time", "DTM", RE),
fld!(45, "Discharge Date/Time", "DTM", O, rep),
fld!(50, "Alternate Visit ID", "CX", O, t "0203"),
fld!(51, "Visit Indicator", "IS", O, t "0326"),
];
const PV2: &[FieldSpec] = &[
fld!(1, "Prior Pending Location", "PL", O),
fld!(3, "Admit Reason", "CE", O),
fld!(8, "Expected Admit Date/Time", "DTM", O),
fld!(9, "Expected Discharge Date/Time", "DTM", O),
fld!(23, "Clinic Organization Name", "XON", O, rep),
fld!(24, "Patient Status Code", "IS", O, t "0216"),
];
const AL1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Allergen Type Code", "CE", O, t "0127"),
fld!(3, "Allergen Code/Mnemonic", "CE", R),
fld!(4, "Allergy Severity Code", "CE", O, t "0128"),
fld!(5, "Allergy Reaction Code", "ST", O, rep),
fld!(6, "Identification Date", "DT", B),
];
const DG1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Diagnosis Coding Method", "ID", B),
fld!(3, "Diagnosis Code", "CE", RE),
fld!(4, "Diagnosis Description", "ST", B),
fld!(5, "Diagnosis Date/Time", "DTM", O),
fld!(6, "Diagnosis Type", "IS", R, t "0052"),
fld!(15, "Diagnosis Priority", "ID", O, t "0359"),
fld!(16, "Diagnosing Clinician", "XCN", O, rep),
fld!(19, "Attestation Date/Time", "DTM", O),
];
const PR1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Procedure Coding Method", "IS", B),
fld!(3, "Procedure Code", "CE", R),
fld!(4, "Procedure Description", "ST", B),
fld!(5, "Procedure Date/Time", "DTM", R),
fld!(6, "Procedure Functional Type", "IS", O, t "0230"),
];
const GT1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Guarantor Number", "CX", O, rep),
fld!(3, "Guarantor Name", "XPN", R, rep),
fld!(5, "Guarantor Address", "XAD", O, rep),
fld!(6, "Guarantor Phone Number - Home", "XTN", O, rep),
fld!(11, "Guarantor Relationship", "CE", O, t "0063"),
];
const IN1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Insurance Plan ID", "CE", R),
fld!(3, "Insurance Company ID", "CX", R, rep),
fld!(4, "Insurance Company Name", "XON", RE, rep),
fld!(5, "Insurance Company Address", "XAD", O, rep),
fld!(8, "Group Number", "ST", O),
fld!(12, "Plan Effective Date", "DT", O),
fld!(13, "Plan Expiration Date", "DT", O),
fld!(16, "Name of Insured", "XPN", O, rep),
fld!(17, "Insured's Relationship to Patient", "CE", O, t "0063"),
fld!(36, "Policy Number", "ST", O),
];
const ORC: &[FieldSpec] = &[
fld!(1, "Order Control", "ID", R, t "0119"),
fld!(2, "Placer Order Number", "EI", RE),
fld!(3, "Filler Order Number", "EI", RE),
fld!(4, "Placer Group Number", "EI", O),
fld!(5, "Order Status", "ID", O, t "0038"),
fld!(7, "Quantity/Timing", "TQ", B, rep),
fld!(9, "Date/Time of Transaction", "DTM", O),
fld!(10, "Entered By", "XCN", O, rep),
fld!(12, "Ordering Provider", "XCN", RE, rep),
fld!(15, "Order Effective Date/Time", "DTM", O),
fld!(16, "Order Control Code Reason", "CE", O),
fld!(17, "Entering Organization", "CE", O),
];
const OBR: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Placer Order Number", "EI", RE),
fld!(3, "Filler Order Number", "EI", RE),
fld!(4, "Universal Service Identifier", "CE", R),
fld!(6, "Requested Date/Time", "DTM", B),
fld!(7, "Observation Date/Time", "DTM", RE),
fld!(8, "Observation End Date/Time", "DTM", O),
fld!(11, "Specimen Action Code", "ID", O, t "0065"),
fld!(13, "Relevant Clinical Information", "ST", O),
fld!(14, "Specimen Received Date/Time", "DTM", O),
fld!(16, "Ordering Provider", "XCN", RE, rep),
fld!(18, "Placer Field 1", "ST", O),
fld!(19, "Placer Field 2", "ST", O),
fld!(20, "Filler Field 1", "ST", O),
fld!(22, "Results Rpt/Status Change Date/Time", "DTM", O),
fld!(24, "Diagnostic Service Section ID", "ID", O, t "0074"),
fld!(25, "Result Status", "ID", RE, t "0123"),
fld!(27, "Quantity/Timing", "TQ", B, rep),
fld!(31, "Reason for Study", "CE", O, rep),
];
const OBX: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Value Type", "ID", RE, t "0125"),
fld!(3, "Observation Identifier", "CE", R),
fld!(4, "Observation Sub-ID", "ST", O),
fld!(5, "Observation Value", "VARIES", RE, rep),
fld!(6, "Units", "CE", O),
fld!(7, "References Range", "ST", O),
fld!(8, "Abnormal Flags", "IS", O, t "0078", rep),
fld!(9, "Probability", "NM", O),
fld!(10, "Nature of Abnormal Test", "ID", O, t "0080", rep),
fld!(11, "Observation Result Status", "ID", R, t "0085"),
fld!(12, "Effective Date of Reference Range", "DTM", O),
fld!(13, "User Defined Access Checks", "ST", O),
fld!(14, "Date/Time of the Observation", "DTM", RE),
fld!(15, "Producer's ID", "CE", O),
fld!(16, "Responsible Observer", "XCN", O, rep),
fld!(17, "Observation Method", "CE", O, rep),
fld!(18, "Equipment Instance Identifier", "EI", O, rep),
fld!(19, "Date/Time of the Analysis", "DTM", O),
];
const NTE: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Source of Comment", "ID", O, t "0105"),
fld!(3, "Comment", "FT", RE, rep),
fld!(4, "Comment Type", "CE", O, t "0364"),
];
const SCH: &[FieldSpec] = &[
fld!(1, "Placer Appointment ID", "EI", RE),
fld!(2, "Filler Appointment ID", "EI", RE),
fld!(6, "Event Reason", "CE", R),
fld!(7, "Appointment Reason", "CE", O, t "0276"),
fld!(8, "Appointment Type", "CE", O, t "0277"),
fld!(9, "Appointment Duration", "NM", O),
fld!(10, "Appointment Duration Units", "CE", O),
fld!(11, "Appointment Timing Quantity", "TQ", B, rep),
fld!(16, "Filler Contact Person", "XCN", R, rep),
fld!(20, "Entered By Person", "XCN", R, rep),
fld!(25, "Filler Status Code", "CE", RE, t "0278"),
];
const RGS: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Segment Action Code", "ID", O),
fld!(3, "Resource Group ID", "CE", O),
];
const AIL: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(3, "Location Resource ID", "PL", RE, rep),
fld!(4, "Location Type", "CE", RE, t "0305"),
fld!(6, "Start Date/Time", "DTM", O),
];
const AIS: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(3, "Universal Service Identifier", "CE", R),
fld!(4, "Start Date/Time", "DTM", O),
];
const AIP: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(3, "Personnel Resource ID", "XCN", RE, rep),
fld!(4, "Resource Role", "CE", RE),
fld!(6, "Start Date/Time", "DTM", O),
];
const TXA: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Document Type", "IS", R, t "0270"),
fld!(4, "Activity Date/Time", "DTM", O),
fld!(5, "Primary Activity Provider", "XCN", O, rep),
fld!(12, "Unique Document Number", "EI", R),
fld!(17, "Document Completion Status", "ID", R, t "0271"),
fld!(18, "Document Confidentiality Status", "ID", O, t "0272"),
];
const RXA: &[FieldSpec] = &[
fld!(1, "Give Sub-ID Counter", "NM", R),
fld!(2, "Administration Sub-ID Counter", "NM", R),
fld!(3, "Date/Time Start of Administration", "DTM", R),
fld!(5, "Administered Code", "CE", R),
fld!(6, "Administered Amount", "NM", R),
fld!(7, "Administered Units", "CE", O),
fld!(9, "Administration Notes", "CE", O, rep),
fld!(20, "Completion Status", "ID", O, t "0322"),
fld!(21, "Action Code", "ID", O, t "0323"),
];
const FT1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(4, "Transaction Date", "DR", R),
fld!(6, "Transaction Type", "IS", R, t "0017"),
fld!(7, "Transaction Code", "CE", R),
fld!(10, "Transaction Quantity", "NM", O),
fld!(11, "Transaction Amount - Extended", "CP", O),
];
const IAM: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Allergen Type Code", "CE", O, t "0127"),
fld!(3, "Allergen Code/Mnemonic", "CE", R),
fld!(4, "Allergy Severity Code", "CE", O, t "0128"),
fld!(5, "Allergy Reaction Code", "ST", O),
fld!(6, "Allergy Action Code", "CNE", R, t "0323"),
fld!(7, "Allergy Unique Identifier", "EI", O),
fld!(8, "Action Reason", "ST", O),
];
const QRD: &[FieldSpec] = &[
fld!(1, "Query Date/Time", "DTM", R),
fld!(2, "Query Format Code", "ID", R, t "0106"),
fld!(3, "Query Priority", "ID", R, t "0091"),
fld!(4, "Query ID", "ST", R),
fld!(7, "Quantity Limited Request", "CQ", R),
fld!(8, "Who Subject Filter", "XCN", R, rep),
fld!(9, "What Subject Filter", "CE", R, rep),
fld!(10, "What Department Data Code", "CE", R, rep),
];
const ACC: &[FieldSpec] = &[
fld!(1, "Accident Date/Time", "TS", O),
fld!(2, "Accident Code", "CE", O),
fld!(3, "Accident Location", "ST", O),
fld!(4, "Auto Accident State", "CE", B),
fld!(5, "Accident Job Related Indicator", "ID", O, t "0136"),
fld!(6, "Accident Death Indicator", "ID", O, t "0136"),
fld!(7, "Entered By", "XCN", O),
fld!(8, "Accident Description", "ST", O),
fld!(9, "Brought In By", "ST", O),
fld!(10, "Police Notified Indicator", "ID", O, t "0136"),
fld!(11, "Accident Address", "XAD", O),
];
const AIG: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Segment Action Code", "ID", O, t "0206"),
fld!(3, "Resource ID", "CE", O),
fld!(4, "Resource Type", "CE", R),
fld!(5, "Resource Group", "CE", O, rep),
fld!(6, "Resource Quantity", "NM", O),
fld!(7, "Resource Quantity Units", "CE", O),
fld!(8, "Start Date/Time", "TS", O),
fld!(9, "Start Date/Time Offset", "NM", O),
fld!(10, "Start Date/Time Offset Units", "CE", O),
fld!(11, "Duration", "NM", O),
fld!(12, "Duration Units", "CE", O),
fld!(13, "Allow Substitution Code", "IS", O),
fld!(14, "Filler Status Code", "CE", O, t "0278"),
];
const BLG: &[FieldSpec] = &[
fld!(1, "When to Charge", "CCD", O),
fld!(2, "Charge Type", "ID", O),
fld!(3, "Account ID", "CX", O),
fld!(4, "Charge Type Reason", "CWE", O),
];
const CTD: &[FieldSpec] = &[
fld!(1, "Contact Role", "CE", R, rep),
fld!(2, "Contact Name", "XPN", O, rep),
fld!(3, "Contact Address", "XAD", O, rep),
fld!(4, "Contact Location", "PL", O),
fld!(5, "Contact Communication Information", "XTN", O, rep),
fld!(6, "Preferred Method of Contact", "CE", O),
fld!(7, "Contact Identifiers", "PLN", O, rep),
];
const CTI: &[FieldSpec] = &[
fld!(1, "Sponsor Study ID", "EI", R),
fld!(2, "Study Phase Identifier", "CE", O),
fld!(3, "Study Scheduled Time Point", "CE", O),
];
const DB1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Disabled Person Code", "IS", O),
fld!(3, "Disabled Person Identifier", "CX", O, rep),
fld!(4, "Disabled Indicator", "ID", O, t "0136"),
fld!(5, "Disability Start Date", "DT", O),
fld!(6, "Disability End Date", "DT", O),
fld!(7, "Disability Return to Work Date", "DT", O),
fld!(8, "Disability Unable to Work Date", "DT", O),
];
const DRG: &[FieldSpec] = &[
fld!(1, "Diagnostic Related Group", "CE", O),
fld!(2, "DRG Assigned Date/Time", "TS", O),
fld!(3, "DRG Approval Indicator", "ID", O, t "0136"),
fld!(4, "DRG Grouper Review Code", "IS", O),
fld!(5, "Outlier Type", "CE", O),
fld!(6, "Outlier Days", "NM", O),
fld!(7, "Outlier Cost", "CP", O),
fld!(8, "DRG Payor", "IS", O),
fld!(9, "Outlier Reimbursement", "CP", O),
fld!(10, "Confidential Indicator", "ID", O, t "0136"),
fld!(11, "DRG Transfer Type", "IS", O),
];
const DSC: &[FieldSpec] = &[
fld!(1, "Continuation Pointer", "ST", O),
fld!(2, "Continuation Style", "ID", O),
];
const IN2: &[FieldSpec] = &[
fld!(1, "Insured's Employee ID", "CX", O, rep),
fld!(2, "Insured's Social Security Number", "ST", O),
fld!(3, "Insured's Employer's Name and ID", "XCN", O, rep),
fld!(4, "Employer Information Data", "IS", O),
fld!(5, "Mail Claim Party", "IS", O, rep),
fld!(6, "Medicare Health Ins Card Number", "ST", O),
fld!(7, "Medicaid Case Name", "XPN", O, rep),
fld!(8, "Medicaid Case Number", "ST", O),
fld!(9, "Military Sponsor Name", "XPN", O, rep),
fld!(10, "Military ID Number", "ST", O),
fld!(11, "Dependent Of Military Recipient", "CE", O),
fld!(12, "Military Organization", "ST", O),
fld!(13, "Military Station", "ST", O),
fld!(14, "Military Service", "IS", O),
fld!(15, "Military Rank/Grade", "IS", O),
fld!(16, "Military Status", "IS", O),
fld!(17, "Military Retire Date", "DT", O),
fld!(18, "Military Non-Avail Cert On File", "ID", O, t "0136"),
fld!(19, "Baby Coverage", "ID", O, t "0136"),
fld!(20, "Combine Baby Bill", "ID", O, t "0136"),
fld!(21, "Blood Deductible", "ST", O),
fld!(22, "Special Coverage Approval Name", "XPN", O, rep),
fld!(23, "Special Coverage Approval Title", "ST", O),
fld!(24, "Non-Covered Insurance Code", "IS", O, rep),
fld!(25, "Payor ID", "CX", O, rep),
fld!(26, "Payor Subscriber ID", "CX", O, rep),
fld!(27, "Eligibility Source", "IS", O),
fld!(28, "Room Coverage Type/Amount", "RMC", O, rep),
fld!(29, "Policy Type/Amount", "PTA", O, rep),
fld!(30, "Daily Deductible", "DDI", O),
fld!(31, "Living Dependency", "IS", O, t "0223"),
fld!(32, "Ambulatory Status", "IS", O, t "0009", rep),
fld!(33, "Citizenship", "CE", O, rep),
fld!(34, "Primary Language", "CE", O),
fld!(35, "Living Arrangement", "IS", O, t "0220"),
fld!(36, "Publicity Code", "CE", O, t "0215"),
fld!(37, "Protection Indicator", "ID", O, t "0136"),
fld!(38, "Student Indicator", "IS", O),
fld!(39, "Religion", "CE", O, t "0006"),
fld!(40, "Mother's Maiden Name", "XPN", O, rep),
fld!(41, "Nationality", "CE", O),
fld!(42, "Ethnic Group", "CE", O, t "0189", rep),
fld!(43, "Marital Status", "CE", O, t "0002", rep),
fld!(44, "Insured's Employment Start Date", "DT", O),
fld!(45, "Employment Stop Date", "DT", O),
fld!(46, "Job Title", "ST", O),
fld!(47, "Job Code/Class", "JCC", O),
fld!(48, "Job Status", "IS", O),
fld!(49, "Employer Contact Person Name", "XPN", O, rep),
fld!(50, "Employer Contact Person Phone Number", "XTN", O, rep),
fld!(51, "Employer Contact Reason", "IS", O),
fld!(52, "Insured's Contact Person's Name", "XPN", O, rep),
fld!(53, "Insured's Contact Person Phone Number", "XTN", O, rep),
fld!(54, "Insured's Contact Person Reason", "IS", O, rep),
fld!(55, "Relationship to the Patient Start Date", "DT", O),
fld!(56, "Relationship to the Patient Stop Date", "DT", O, rep),
fld!(57, "Insurance Co. Contact Reason", "IS", O),
fld!(58, "Insurance Co Contact Phone Number", "XTN", O),
fld!(59, "Policy Scope", "IS", O),
fld!(60, "Policy Source", "IS", O),
fld!(61, "Patient Member Number", "CX", O),
fld!(62, "Guarantor's Relationship to Insured", "CE", O, t "0063"),
fld!(63, "Insured's Phone Number - Home", "XTN", O, rep),
fld!(64, "Insured's Employer Phone Number", "XTN", O, rep),
fld!(65, "Military Handicapped Program", "CE", O),
fld!(66, "Suspend Flag", "ID", O, t "0136"),
fld!(67, "Copay Limit Flag", "ID", O, t "0136"),
fld!(68, "Stoploss Limit Flag", "ID", O, t "0136"),
fld!(69, "Insured Organization Name and ID", "XON", O, rep),
fld!(
70,
"Insured Employer Organization Name and ID",
"XON",
O,
rep
),
fld!(71, "Race", "CE", O, rep),
fld!(72, "CMS Patient's Relationship to Insured", "CE", O),
];
const IN3: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Certification Number", "CX", O),
fld!(3, "Certified By", "XCN", O, rep),
fld!(4, "Certification Required", "ID", O, t "0136"),
fld!(5, "Penalty", "MOP", O),
fld!(6, "Certification Date/Time", "TS", O),
fld!(7, "Certification Modify Date/Time", "TS", O),
fld!(8, "Operator", "XCN", O, rep),
fld!(9, "Certification Begin Date", "DT", O),
fld!(10, "Certification End Date", "DT", O),
fld!(11, "Days", "DTN", O),
fld!(12, "Non-Concur Code/Description", "CE", O),
fld!(13, "Non-Concur Effective Date/Time", "TS", O),
fld!(14, "Physician Reviewer", "XCN", O, rep),
fld!(15, "Certification Contact", "ST", O),
fld!(16, "Certification Contact Phone Number", "XTN", O, rep),
fld!(17, "Appeal Reason", "CE", O),
fld!(18, "Certification Agency", "CE", O),
fld!(19, "Certification Agency Phone Number", "XTN", O, rep),
fld!(20, "Pre-Certification Requirement", "ICD", O, rep),
fld!(21, "Case Manager", "ST", O),
fld!(22, "Second Opinion Date", "DT", O),
fld!(23, "Second Opinion Status", "IS", O),
fld!(24, "Second Opinion Documentation Received", "IS", O, rep),
fld!(25, "Second Opinion Physician", "XCN", O, rep),
];
const MRG: &[FieldSpec] = &[
fld!(1, "Prior Patient Identifier List", "CX", R, rep),
fld!(2, "Prior Alternate Patient ID", "CX", B, rep),
fld!(3, "Prior Patient Account Number", "CX", O),
fld!(4, "Prior Patient ID", "CX", B),
fld!(5, "Prior Visit Number", "CX", O),
fld!(6, "Prior Alternate Visit ID", "CX", O),
fld!(7, "Prior Patient Name", "XPN", O, rep),
];
const ODS: &[FieldSpec] = &[
fld!(1, "Type", "ID", R),
fld!(2, "Service Period", "CE", O, rep),
fld!(3, "Diet, Supplement, or Preference Code", "CE", R, rep),
fld!(4, "Text Instruction", "ST", O, rep),
];
const PDA: &[FieldSpec] = &[
fld!(1, "Death Cause Code", "CE", O, rep),
fld!(2, "Death Location", "PL", O),
fld!(3, "Death Certified Indicator", "ID", O, t "0136"),
fld!(4, "Death Certificate Signed Date/Time", "TS", O),
fld!(5, "Death Certified By", "XCN", O),
fld!(6, "Autopsy Indicator", "ID", O, t "0136"),
fld!(7, "Autopsy Start and End Date/Time", "DR", O),
fld!(8, "Autopsy Performed By", "XCN", O),
fld!(9, "Coroner Indicator", "ID", O, t "0136"),
];
const ROL: &[FieldSpec] = &[
fld!(1, "Role Instance ID", "EI", O),
fld!(2, "Action Code", "ID", R),
fld!(3, "Role", "CE", R),
fld!(4, "Role Person", "XCN", R, rep),
fld!(5, "Role Begin Date/Time", "TS", O),
fld!(6, "Role End Date/Time", "TS", O),
fld!(7, "Role Duration", "CE", O),
fld!(8, "Role Action Reason", "CE", O),
fld!(9, "Provider Type", "CE", O, rep),
fld!(10, "Organization Unit Type", "CE", O),
fld!(11, "Office/Home Address/Birthplace", "XAD", O, rep),
fld!(12, "Phone", "XTN", O, rep),
];
const RQD: &[FieldSpec] = &[
fld!(1, "Requisition Line Number", "SI", O),
fld!(2, "Item Code - Internal", "CE", O),
fld!(3, "Item Code - External", "CE", O),
fld!(4, "Hospital Item Code", "CE", O),
fld!(5, "Requisition Quantity", "NM", O),
fld!(6, "Requisition Unit of Measure", "CE", O),
fld!(7, "Dept. Cost Center", "IS", O),
fld!(8, "Item Natural Account Code", "IS", O),
fld!(9, "Deliver To ID", "CE", O),
fld!(10, "Date Needed", "DT", O),
];
const RXC: &[FieldSpec] = &[
fld!(1, "RX Component Type", "ID", R),
fld!(2, "Component Code", "CE", R),
fld!(3, "Component Amount", "NM", R),
fld!(4, "Component Units", "CE", R),
fld!(5, "Component Strength", "NM", O),
fld!(6, "Component Strength Units", "CE", O),
fld!(7, "Supplementary Code", "CE", O, rep),
fld!(8, "Component Drug Strength Volume", "NM", O),
fld!(9, "Component Drug Strength Volume Units", "CWE", O),
];
const RXE: &[FieldSpec] = &[
fld!(1, "Quantity/Timing", "TQ", B),
fld!(2, "Give Code", "CE", R),
fld!(3, "Give Amount - Minimum", "NM", R),
fld!(4, "Give Amount - Maximum", "NM", O),
fld!(5, "Give Units", "CE", R),
fld!(6, "Give Dosage Form", "CE", O),
fld!(7, "Provider's Administration Instructions", "CE", O, rep),
fld!(8, "Deliver-to Location", "LA1", B),
fld!(9, "Substitution Status", "ID", O),
fld!(10, "Dispense Amount", "NM", O),
fld!(11, "Dispense Units", "CE", O),
fld!(12, "Number of Refills", "NM", O),
fld!(13, "Ordering Provider's DEA Number", "XCN", O, rep),
fld!(
14,
"Pharmacist/Treatment Supplier's Verifier ID",
"XCN",
O,
rep
),
fld!(15, "Prescription Number", "ST", O),
fld!(16, "Number of Refills Remaining", "NM", O),
fld!(17, "Number of Refills/Doses Dispensed", "NM", O),
fld!(18, "D/T of Most Recent Refill or Dose Dispensed", "TS", O),
fld!(19, "Total Daily Dose", "CQ", O),
fld!(20, "Needs Human Review", "ID", O, t "0136"),
fld!(
21,
"Pharmacy/Treatment Supplier's Special Dispensing Instructions",
"CE",
O,
rep
),
fld!(22, "Give Per (Time Unit)", "ST", O),
fld!(23, "Give Rate Amount", "ST", O),
fld!(24, "Give Rate Units", "CE", O),
fld!(25, "Give Strength", "NM", O),
fld!(26, "Give Strength Units", "CE", O),
fld!(27, "Give Indication", "CE", O, rep),
fld!(28, "Dispense Package Size", "NM", O),
fld!(29, "Dispense Package Size Unit", "CE", O),
fld!(30, "Dispense Package Method", "ID", O),
fld!(31, "Supplementary Code", "CE", O, rep),
fld!(32, "Original Order Date/Time", "TS", O),
fld!(33, "Give Drug Strength Volume", "NM", O),
fld!(34, "Give Drug Strength Volume Units", "CWE", O),
fld!(35, "Controlled Substance Schedule", "CWE", O),
fld!(36, "Formulary Status", "ID", O),
fld!(37, "Pharmaceutical Substance Alternative", "CWE", O, rep),
fld!(38, "Pharmacy of Most Recent Fill", "CWE", O),
fld!(39, "Initial Dispense Amount", "NM", O),
fld!(40, "Dispensing Pharmacy", "CWE", O),
fld!(41, "Dispensing Pharmacy Address", "XAD", O),
fld!(42, "Deliver-to Patient Location", "PL", O),
fld!(43, "Deliver-to Address", "XAD", O),
fld!(44, "Pharmacy Order Type", "ID", O),
];
const RXO: &[FieldSpec] = &[
fld!(1, "Requested Give Code", "CE", O),
fld!(2, "Requested Give Amount - Minimum", "NM", O),
fld!(3, "Requested Give Amount - Maximum", "NM", O),
fld!(4, "Requested Give Units", "CE", O),
fld!(5, "Requested Dosage Form", "CE", O),
fld!(
6,
"Provider's Pharmacy/Treatment Instructions",
"CE",
O,
rep
),
fld!(7, "Provider's Administration Instructions", "CE", O, rep),
fld!(8, "Deliver-To Location", "LA1", O),
fld!(9, "Allow Substitutions", "ID", O),
fld!(10, "Requested Dispense Code", "CE", O),
fld!(11, "Requested Dispense Amount", "NM", O),
fld!(12, "Requested Dispense Units", "CE", O),
fld!(13, "Number Of Refills", "NM", O),
fld!(14, "Ordering Provider's DEA Number", "XCN", O, rep),
fld!(
15,
"Pharmacist/Treatment Supplier's Verifier ID",
"XCN",
O,
rep
),
fld!(16, "Needs Human Review", "ID", O, t "0136"),
fld!(17, "Requested Give Per (Time Unit)", "ST", O),
fld!(18, "Requested Give Strength", "NM", O),
fld!(19, "Requested Give Strength Units", "CE", O),
fld!(20, "Indication", "CE", O, rep),
fld!(21, "Requested Give Rate Amount", "ST", O),
fld!(22, "Requested Give Rate Units", "CE", O),
fld!(23, "Total Daily Dose", "CQ", O),
fld!(24, "Supplementary Code", "CE", O, rep),
fld!(25, "Requested Drug Strength Volume", "NM", O),
fld!(26, "Requested Drug Strength Volume Units", "CWE", O),
fld!(27, "Pharmacy Order Type", "ID", O),
fld!(28, "Dispensing Interval", "NM", O),
];
const RXR: &[FieldSpec] = &[
fld!(1, "Route", "CE", R),
fld!(2, "Administration Site", "CWE", O),
fld!(3, "Administration Device", "CE", O),
fld!(4, "Administration Method", "CWE", O),
fld!(5, "Routing Instruction", "CE", O),
fld!(6, "Administration Site Modifier", "CWE", O),
];
const SFT: &[FieldSpec] = &[
fld!(1, "Software Vendor Organization", "XON", R),
fld!(2, "Software Certified Version or Release Number", "ST", R),
fld!(3, "Software Product Name", "ST", R),
fld!(4, "Software Binary ID", "ST", R),
fld!(5, "Software Product Information", "TX", O),
fld!(6, "Software Install Date", "TS", O),
];
const SPM: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Specimen ID", "EIP", O),
fld!(3, "Specimen Parent IDs", "EIP", O, rep),
fld!(4, "Specimen Type", "CWE", R),
fld!(5, "Specimen Type Modifier", "CWE", O, rep),
fld!(6, "Specimen Additives", "CWE", O, rep),
fld!(7, "Specimen Collection Method", "CWE", O),
fld!(8, "Specimen Source Site", "CWE", O),
fld!(9, "Specimen Source Site Modifier", "CWE", O, rep),
fld!(10, "Specimen Collection Site", "CWE", O),
fld!(11, "Specimen Role", "CWE", O, rep),
fld!(12, "Specimen Collection Amount", "CQ", O),
fld!(13, "Grouped Specimen Count", "NM", O),
fld!(14, "Specimen Description", "ST", O, rep),
fld!(15, "Specimen Handling Code", "CWE", O, rep),
fld!(16, "Specimen Risk Code", "CWE", O, rep),
fld!(17, "Specimen Collection Date/Time", "DR", O),
fld!(18, "Specimen Received Date/Time", "TS", O),
fld!(19, "Specimen Expiration Date/Time", "TS", O),
fld!(20, "Specimen Availability", "ID", O, t "0136"),
fld!(21, "Specimen Reject Reason", "CWE", O, rep),
fld!(22, "Specimen Quality", "CWE", O),
fld!(23, "Specimen Appropriateness", "CWE", O),
fld!(24, "Specimen Condition", "CWE", O, rep),
fld!(25, "Specimen Current Quantity", "CQ", O),
fld!(26, "Number of Specimen Containers", "NM", O),
fld!(27, "Container Type", "CWE", O),
fld!(28, "Container Condition", "CWE", O),
fld!(29, "Specimen Child Role", "CWE", O),
];
const TQ1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Quantity", "CQ", O),
fld!(3, "Repeat Pattern", "RPT", O, rep),
fld!(4, "Explicit Time", "TM", O, rep),
fld!(5, "Relative Time and Units", "CQ", O, rep),
fld!(6, "Service Duration", "CQ", O),
fld!(7, "Start date/time", "TS", O),
fld!(8, "End date/time", "TS", O),
fld!(9, "Priority", "CWE", O, rep),
fld!(10, "Condition text", "TX", O),
fld!(11, "Text instruction", "TX", O),
fld!(12, "Conjunction", "ID", O),
fld!(13, "Occurrence duration", "CQ", O),
fld!(14, "Total occurrence's", "NM", O),
];
const TQ2: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Sequence/Results Flag", "ID", O),
fld!(3, "Related Placer Number", "EI", O, rep),
fld!(4, "Related Filler Number", "EI", O, rep),
fld!(5, "Related Placer Group Number", "EI", O, rep),
fld!(6, "Sequence Condition Code", "ID", O),
fld!(7, "Cyclic Entry/Exit Indicator", "ID", O),
fld!(8, "Sequence Condition Time Interval", "CQ", O),
fld!(9, "Cyclic Group Maximum Number of Repeats", "NM", O),
fld!(10, "Special Service Request Relationship", "ID", O),
];
const UB1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Blood Deductible (43)", "NM", B),
fld!(3, "Blood Furnished-Pints Of (40)", "NM", O),
fld!(4, "Blood Replaced-Pints (41)", "NM", O),
fld!(5, "Blood Not Replaced-Pints(42)", "NM", O),
fld!(6, "Co-Insurance Days (25)", "NM", O),
fld!(7, "Condition Code (35-39)", "IS", O, rep),
fld!(8, "Covered Days - (23)", "NM", O),
fld!(9, "Non Covered Days - (24)", "NM", O),
fld!(10, "Value Amount & Code (46-49)", "UVC", O, rep),
fld!(11, "Number Of Grace Days (90)", "NM", O),
fld!(12, "Special Program Indicator (44)", "CE", O),
fld!(13, "PSRO/UR Approval Indicator (87)", "CE", O),
fld!(14, "PSRO/UR Approved Stay-Fm (88)", "DT", O),
fld!(15, "PSRO/UR Approved Stay-To (89)", "DT", O),
fld!(16, "Occurrence (28-32)", "OCD", O, rep),
fld!(17, "Occurrence Span (33)", "CE", O),
fld!(18, "Occur Span Start Date(33)", "DT", O),
fld!(19, "Occur Span End Date (33)", "DT", O),
fld!(20, "UB-82 Locator 2", "ST", B),
fld!(21, "UB-82 Locator 9", "ST", B),
fld!(22, "UB-82 Locator 27", "ST", B),
fld!(23, "UB-82 Locator 45", "ST", B),
];
const UB2: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Co-Insurance Days (9)", "ST", O),
fld!(3, "Condition Code (24-30)", "IS", O, rep),
fld!(4, "Covered Days (7)", "ST", O),
fld!(5, "Non-Covered Days (8)", "ST", O),
fld!(6, "Value Amount & Code", "UVC", O, rep),
fld!(7, "Occurrence Code & Date (32-35)", "OCD", O, rep),
fld!(8, "Occurrence Span Code/Dates (36)", "OSP", O, rep),
fld!(9, "UB92 Locator 2 (State)", "ST", O, rep),
fld!(10, "UB92 Locator 11 (State)", "ST", O, rep),
fld!(11, "UB92 Locator 31 (National)", "ST", O),
fld!(12, "Document Control Number", "ST", O, rep),
fld!(13, "UB92 Locator 49 (National)", "ST", O, rep),
fld!(14, "UB92 Locator 56 (State)", "ST", O, rep),
fld!(15, "UB92 Locator 57 (National)", "ST", O),
fld!(16, "UB92 Locator 78 (State)", "ST", O, rep),
fld!(17, "Special Visit Count", "NM", O),
];
const ABS: &[FieldSpec] = &[
fld!(1, "Discharge Care Provider", "XCN", O),
fld!(2, "Transfer Medical Service Code", "CE", O),
fld!(3, "Severity of Illness Code", "CE", O),
fld!(4, "Date/Time of Attestation", "TS", O),
fld!(5, "Attested By", "XCN", O),
fld!(6, "Triage Code", "CE", O),
fld!(7, "Abstract Completion Date/Time", "TS", O),
fld!(8, "Abstracted By", "XCN", O),
fld!(9, "Case Category Code", "CE", O),
fld!(10, "Caesarian Section Indicator", "ID", O, t "0136"),
fld!(11, "Gestation Category Code", "CE", O),
fld!(12, "Gestation Period - Weeks", "NM", O),
fld!(13, "Newborn Code", "CE", O),
fld!(14, "Stillborn Indicator", "ID", O, t "0136"),
];
const AFF: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Professional Organization", "XON", R),
fld!(3, "Professional Organization Address", "XAD", O),
fld!(
4,
"Professional Organization Affiliation Date Range",
"DR",
O,
rep
),
fld!(
5,
"Professional Affiliation Additional Information",
"ST",
O
),
];
const APR: &[FieldSpec] = &[
fld!(1, "Time Selection Criteria", "SCV", O, rep),
fld!(2, "Resource Selection Criteria", "SCV", O, rep),
fld!(3, "Location Selection Criteria", "SCV", O, rep),
fld!(4, "Slot Spacing Criteria", "NM", O),
fld!(5, "Filler Override Criteria", "SCV", O, rep),
];
const ARQ: &[FieldSpec] = &[
fld!(1, "Placer Appointment ID", "EI", R),
fld!(2, "Filler Appointment ID", "EI", O),
fld!(3, "Occurrence Number", "NM", O),
fld!(4, "Placer Group Number", "EI", O),
fld!(5, "Schedule ID", "CE", O),
fld!(6, "Request Event Reason", "CE", O),
fld!(7, "Appointment Reason", "CE", O, t "0276"),
fld!(8, "Appointment Type", "CE", O, t "0277"),
fld!(9, "Appointment Duration", "NM", O),
fld!(10, "Appointment Duration Units", "CE", O),
fld!(11, "Requested Start Date/Time Range", "DR", O, rep),
fld!(12, "Priority", "ST", O),
fld!(13, "Repeating Interval", "RI", O),
fld!(14, "Repeating Interval Duration", "ST", O),
fld!(15, "Placer Contact Person", "XCN", R, rep),
fld!(16, "Placer Contact Phone Number", "XTN", O, rep),
fld!(17, "Placer Contact Address", "XAD", O, rep),
fld!(18, "Placer Contact Location", "PL", O),
fld!(19, "Entered By Person", "XCN", R, rep),
fld!(20, "Entered By Phone Number", "XTN", O, rep),
fld!(21, "Entered By Location", "PL", O),
fld!(22, "Parent Placer Appointment ID", "EI", O),
fld!(23, "Parent Filler Appointment ID", "EI", O),
fld!(24, "Placer Order Number", "EI", O, rep),
fld!(25, "Filler Order Number", "EI", O, rep),
];
const AUT: &[FieldSpec] = &[
fld!(1, "Authorizing Payor, Plan ID", "CE", O),
fld!(2, "Authorizing Payor, Company ID", "CE", R),
fld!(3, "Authorizing Payor, Company Name", "ST", O),
fld!(4, "Authorization Effective Date", "TS", O),
fld!(5, "Authorization Expiration Date", "TS", O),
fld!(6, "Authorization Identifier", "EI", O),
fld!(7, "Reimbursement Limit", "CP", O),
fld!(8, "Requested Number of Treatments", "NM", O),
fld!(9, "Authorized Number of Treatments", "NM", O),
fld!(10, "Process Date", "TS", O),
];
const BHS: &[FieldSpec] = &[
fld!(1, "Batch Field Separator", "ST", R),
fld!(2, "Batch Encoding Characters", "ST", R),
fld!(3, "Batch Sending Application", "HD", O),
fld!(4, "Batch Sending Facility", "HD", O),
fld!(5, "Batch Receiving Application", "HD", O),
fld!(6, "Batch Receiving Facility", "HD", O),
fld!(7, "Batch Creation Date/Time", "TS", O),
fld!(8, "Batch Security", "ST", O),
fld!(9, "Batch Name/ID/Type", "ST", O),
fld!(10, "Batch Comment", "ST", O),
fld!(11, "Batch Control ID", "ST", O),
fld!(12, "Reference Batch Control ID", "ST", O),
];
const BLC: &[FieldSpec] = &[
fld!(1, "Blood Product Code", "CE", O),
fld!(2, "Blood Amount", "CQ", O),
];
const BPO: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "BP Universal Service ID", "CWE", R),
fld!(3, "BP Processing Requirements", "CWE", O, rep),
fld!(4, "BP Quantity", "NM", R),
fld!(5, "BP Amount", "NM", O),
fld!(6, "BP Units", "CE", O),
fld!(7, "BP Intended Use Date/Time", "TS", O),
fld!(8, "BP Intended Dispense From Location", "PL", O),
fld!(9, "BP Intended Dispense From Address", "XAD", O),
fld!(10, "BP Requested Dispense Date/Time", "TS", O),
fld!(11, "BP Requested Dispense To Location", "PL", O),
fld!(12, "BP Requested Dispense To Address", "XAD", O),
fld!(13, "BP Indication for Use", "CWE", O, rep),
fld!(14, "BP Informed Consent Indicator", "ID", O, t "0136"),
];
const BPX: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "BP Dispense Status", "CWE", R),
fld!(3, "BP Status", "ID", R),
fld!(4, "BP Date/Time of Status", "TS", R),
fld!(5, "BC Donation ID", "EI", O),
fld!(6, "BC Component", "CNE", O),
fld!(7, "BC Donation Type / Intended Use", "CNE", O),
fld!(8, "CP Commercial Product", "CWE", O),
fld!(9, "CP Manufacturer", "XON", O),
fld!(10, "CP Lot Number", "EI", O),
fld!(11, "BP Blood Group", "CNE", O),
fld!(12, "BC Special Testing", "CNE", O, rep),
fld!(13, "BP Expiration Date/Time", "TS", O),
fld!(14, "BP Quantity", "NM", R),
fld!(15, "BP Amount", "NM", O),
fld!(16, "BP Units", "CE", O),
fld!(17, "BP Unique ID", "EI", O),
fld!(18, "BP Actual Dispensed To Location", "PL", O),
fld!(19, "BP Actual Dispensed To Address", "XAD", O),
fld!(20, "BP Dispensed to Receiver", "XCN", O),
fld!(21, "BP Dispensing Individual", "XCN", O),
];
const BTS: &[FieldSpec] = &[
fld!(1, "Batch Message Count", "ST", O),
fld!(2, "Batch Comment", "ST", O),
fld!(3, "Batch Totals", "NM", O, rep),
];
const BTX: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "BC Donation ID", "EI", O),
fld!(3, "BC Component", "CNE", O),
fld!(4, "BC Blood Group", "CNE", O),
fld!(5, "CP Commercial Product", "CWE", O),
fld!(6, "CP Manufacturer", "XON", O),
fld!(7, "CP Lot Number", "EI", O),
fld!(8, "BP Quantity", "NM", R),
fld!(9, "BP Amount", "NM", O),
fld!(10, "BP Units", "CE", O),
fld!(11, "BP Transfusion/Disposition Status", "CWE", R),
fld!(12, "BP Message Status", "ID", R),
fld!(13, "BP Date/Time of Status", "TS", R),
fld!(14, "BP Administrator", "XCN", O),
fld!(15, "BP Verifier", "XCN", O),
fld!(16, "BP Transfusion Start Date/Time of Status", "TS", O),
fld!(17, "BP Transfusion End Date/Time of Status", "TS", O),
fld!(18, "BP Adverse Reaction Type", "CWE", O, rep),
fld!(19, "BP Transfusion Interrupted Reason", "CWE", O),
];
const CDM: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "CE", R),
fld!(2, "Charge Code Alias", "CE", O, rep),
fld!(3, "Charge Description Short", "ST", R),
fld!(4, "Charge Description Long", "ST", O),
fld!(5, "Description Override Indicator", "IS", O),
fld!(6, "Exploding Charges", "CE", O, rep),
fld!(7, "Procedure Code", "CE", O, rep),
fld!(8, "Active/Inactive Flag", "ID", O),
fld!(9, "Inventory Number", "CE", O, rep),
fld!(10, "Resource Load", "NM", O),
fld!(11, "Contract Number", "CX", O, rep),
fld!(12, "Contract Organization", "XON", O, rep),
fld!(13, "Room Fee Indicator", "ID", O, t "0136"),
];
const CER: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Serial Number", "ST", O),
fld!(3, "Version", "ST", O),
fld!(4, "Granting Authority", "XON", O),
fld!(5, "Issuing Authority", "XCN", O),
fld!(6, "Signature of Issuing Authority", "ED", O),
fld!(7, "Granting Country", "ID", O),
fld!(8, "Granting State/Province", "CWE", O),
fld!(9, "Granting County/Parish", "CWE", O),
fld!(10, "Certificate Type", "CWE", O),
fld!(11, "Certificate Domain", "CWE", O),
fld!(12, "Subject ID", "ID", O),
fld!(13, "Subject Name", "ST", R),
fld!(
14,
"Subject Directory Attribute Extension (Health Professional Data)",
"CWE",
O,
rep
),
fld!(15, "Subject Public Key Info", "CWE", O),
fld!(16, "Authority Key Identifier", "CWE", O),
fld!(17, "Basic Constraint", "ID", O, t "0136"),
fld!(18, "CRL Distribution Point", "CWE", O, rep),
fld!(19, "Jurisdiction Country", "ID", O),
fld!(20, "Jurisdiction State/Province", "CWE", O),
fld!(21, "Jurisdiction County/Parish", "CWE", O),
fld!(22, "Jurisdiction Breadth", "CWE", O, rep),
fld!(23, "Granting Date", "TS", O),
fld!(24, "Issuing Date", "TS", O),
fld!(25, "Activation Date", "TS", O),
fld!(26, "Inactivation Date", "TS", O),
fld!(27, "Expiration Date", "TS", O),
fld!(28, "Renewal Date", "TS", O),
fld!(29, "Revocation Date", "TS", O),
fld!(30, "Revocation Reason Code", "CE", O),
fld!(31, "Certificate Status", "CWE", O),
];
const CM0: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Sponsor Study ID", "EI", R),
fld!(3, "Alternate Study ID", "EI", O, rep),
fld!(4, "Title of Study", "ST", R),
fld!(5, "Chairman of Study", "XCN", O, rep),
fld!(6, "Last IRB Approval Date", "DT", O),
fld!(7, "Total Accrual to Date", "NM", O),
fld!(8, "Last Accrual Date", "DT", O),
fld!(9, "Contact for Study", "XCN", O, rep),
fld!(10, "Contact's Telephone Number", "XTN", O),
fld!(11, "Contact's Address", "XAD", O, rep),
];
const CM1: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Study Phase Identifier", "CE", R),
fld!(3, "Description of Study Phase", "ST", R),
];
const CM2: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", O),
fld!(2, "Scheduled Time Point", "CE", R),
fld!(3, "Description of Time Point", "ST", O),
fld!(4, "Events Scheduled This Time Point", "CE", R, rep),
];
const CON: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Consent Type", "CWE", O),
fld!(3, "Consent Form ID", "ST", O),
fld!(4, "Consent Form Number", "EI", O),
fld!(5, "Consent Text", "FT", O, rep),
fld!(6, "Subject-specific Consent Text", "FT", O, rep),
fld!(7, "Consent Background", "FT", O, rep),
fld!(8, "Subject-specific Consent Background", "FT", O, rep),
fld!(9, "Consenter-imposed limitations", "FT", O, rep),
fld!(10, "Consent Mode", "CNE", O),
fld!(11, "Consent Status", "CNE", R),
fld!(12, "Consent Discussion Date/Time", "TS", O),
fld!(13, "Consent Decision Date/Time", "TS", O),
fld!(14, "Consent Effective Date/Time", "TS", O),
fld!(15, "Consent End Date/Time", "TS", O),
fld!(16, "Subject Competence Indicator", "ID", O, t "0136"),
fld!(17, "Translator Assistance Indicator", "ID", O, t "0136"),
fld!(18, "Language Translated To", "ID", O),
fld!(19, "Informational Material Supplied Indicator", "ID", O, t "0136"),
fld!(20, "Consent Bypass Reason", "CWE", O),
fld!(21, "Consent Disclosure Level", "ID", O),
fld!(22, "Consent Non-disclosure Reason", "CWE", O),
fld!(23, "Non-subject Consenter Reason", "CWE", O),
fld!(24, "Consenter ID", "XPN", R, rep),
fld!(25, "Relationship to Subject Table", "IS", R, rep),
];
const CSP: &[FieldSpec] = &[
fld!(1, "Study Phase Identifier", "CE", R),
fld!(2, "Date/time Study Phase Began", "TS", R),
fld!(3, "Date/time Study Phase Ended", "TS", O),
fld!(4, "Study Phase Evaluability", "CE", O),
];
const CSR: &[FieldSpec] = &[
fld!(1, "Sponsor Study ID", "EI", R),
fld!(2, "Alternate Study ID", "EI", O),
fld!(3, "Institution Registering the Patient", "CE", O),
fld!(4, "Sponsor Patient ID", "CX", R),
fld!(5, "Alternate Patient ID", "CX", O),
fld!(6, "Date/Time Of Patient Study Registration", "TS", R),
fld!(7, "Person Performing Study Registration", "XCN", O, rep),
fld!(8, "Study Authorizing Provider", "XCN", R, rep),
fld!(9, "Date/time Patient Study Consent Signed", "TS", O),
fld!(10, "Patient Study Eligibility Status", "CE", O),
fld!(11, "Study Randomization Date/time", "TS", O, rep),
fld!(12, "Randomized Study Arm", "CE", O, rep),
fld!(13, "Stratum for Study Randomization", "CE", O, rep),
fld!(14, "Patient Evaluability Status", "CE", O),
fld!(15, "Date/time Ended Study", "TS", O),
fld!(16, "Reason Ended Study", "CE", O),
];
const CSS: &[FieldSpec] = &[
fld!(1, "Study Scheduled Time Point", "CE", R),
fld!(2, "Study Scheduled Patient Time Point", "TS", O),
fld!(3, "Study Quality Control Codes", "CE", O, rep),
];
const EDU: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Academic Degree", "IS", O),
fld!(3, "Academic Degree Program Date Range", "DR", O),
fld!(
4,
"Academic Degree Program Participation Date Range",
"DR",
O
),
fld!(5, "Academic Degree Granted Date", "DT", O),
fld!(6, "School", "XON", O),
fld!(7, "School Type Code", "CE", O),
fld!(8, "School Address", "XAD", O),
fld!(9, "Major Field of Study", "CWE", O, rep),
];
const FAC: &[FieldSpec] = &[
fld!(1, "Facility ID", "EI", R),
fld!(2, "Facility Type", "ID", O),
fld!(3, "Facility Address", "XAD", R, rep),
fld!(4, "Facility Telecommunication", "XTN", R),
fld!(5, "Contact Person", "XCN", O, rep),
fld!(6, "Contact Title", "ST", O, rep),
fld!(7, "Contact Address", "XAD", O, rep),
fld!(8, "Contact Telecommunication", "XTN", O, rep),
fld!(9, "Signature Authority", "XCN", R, rep),
fld!(10, "Signature Authority Title", "ST", O),
fld!(11, "Signature Authority Address", "XAD", O, rep),
fld!(12, "Signature Authority Telecommunication", "XTN", O),
];
const FHS: &[FieldSpec] = &[
fld!(1, "File Field Separator", "ST", R),
fld!(2, "File Encoding Characters", "ST", R),
fld!(3, "File Sending Application", "HD", O),
fld!(4, "File Sending Facility", "HD", O),
fld!(5, "File Receiving Application", "HD", O),
fld!(6, "File Receiving Facility", "HD", O),
fld!(7, "File Creation Date/Time", "TS", O),
fld!(8, "File Security", "ST", O),
fld!(9, "File Name/ID", "ST", O),
fld!(10, "File Header Comment", "ST", O),
fld!(11, "File Control ID", "ST", O),
fld!(12, "Reference File Control ID", "ST", O),
];
const FTS: &[FieldSpec] = &[
fld!(1, "File Batch Count", "NM", O),
fld!(2, "File Trailer Comment", "ST", O),
];
const GOL: &[FieldSpec] = &[
fld!(1, "Action Code", "ID", R),
fld!(2, "Action Date/Time", "TS", R),
fld!(3, "Goal ID", "CE", R),
fld!(4, "Goal Instance ID", "EI", R),
fld!(5, "Episode of Care ID", "EI", O),
fld!(6, "Goal List Priority", "NM", O),
fld!(7, "Goal Established Date/Time", "TS", O),
fld!(8, "Expected Goal Achieve Date/Time", "TS", O),
fld!(9, "Goal Classification", "CE", O),
fld!(10, "Goal Management Discipline", "CE", O),
fld!(11, "Current Goal Review Status", "CE", O),
fld!(12, "Current Goal Review Date/Time", "TS", O),
fld!(13, "Next Goal Review Date/Time", "TS", O),
fld!(14, "Previous Goal Review Date/Time", "TS", O),
fld!(15, "Goal Review Interval", "TQ", O),
fld!(16, "Goal Evaluation", "CE", O),
fld!(17, "Goal Evaluation Comment", "ST", O, rep),
fld!(18, "Goal Life Cycle Status", "CE", O),
fld!(19, "Goal Life Cycle Status Date/Time", "TS", O),
fld!(20, "Goal Target Type", "CE", O, rep),
fld!(21, "Goal Target Name", "XPN", O, rep),
];
const GP1: &[FieldSpec] = &[
fld!(1, "Type of Bill Code", "IS", R),
fld!(2, "Revenue Code", "IS", O, rep),
fld!(3, "Overall Claim Disposition Code", "IS", O),
fld!(4, "OCE Edits per Visit Code", "IS", O, rep),
fld!(5, "Outlier Cost", "CP", O),
];
const GP2: &[FieldSpec] = &[
fld!(1, "Revenue Code", "IS", O),
fld!(2, "Number of Service Units", "NM", O),
fld!(3, "Charge", "CP", O),
fld!(4, "Reimbursement Action Code", "IS", O),
fld!(5, "Denial or Rejection Code", "IS", O),
fld!(6, "OCE Edit Code", "IS", O, rep),
fld!(7, "Ambulatory Payment Classification Code", "CE", O),
fld!(8, "Modifier Edit Code", "IS", O, rep),
fld!(9, "Payment Adjustment Code", "IS", O),
fld!(10, "Packaging Status Code", "IS", O),
fld!(11, "Expected CMS Payment Amount", "CP", O),
fld!(12, "Reimbursement Type Code", "IS", O),
fld!(13, "Co-Pay Amount", "CP", O),
fld!(14, "Pay Rate per Service Unit", "NM", O),
];
const IIM: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "CWE", R),
fld!(2, "Service Item Code", "CWE", R),
fld!(3, "Inventory Lot Number", "ST", O),
fld!(4, "Inventory Expiration Date", "TS", O),
fld!(5, "Inventory Manufacturer Name", "CWE", O),
fld!(6, "Inventory Location", "CWE", O),
fld!(7, "Inventory Received Date", "TS", O),
fld!(8, "Inventory Received Quantity", "NM", O),
fld!(9, "Inventory Received Quantity Unit", "CWE", O),
fld!(10, "Inventory Received Item Cost", "MO", O),
fld!(11, "Inventory On Hand Date", "TS", O),
fld!(12, "Inventory On Hand Quantity", "NM", O),
fld!(13, "Inventory On Hand Quantity Unit", "CWE", O),
fld!(14, "Procedure Code", "CE", O),
fld!(15, "Procedure Code Modifier", "CE", O, rep),
];
const IPC: &[FieldSpec] = &[
fld!(1, "Accession Identifier", "EI", R),
fld!(2, "Requested Procedure ID", "EI", R),
fld!(3, "Study Instance UID", "EI", R),
fld!(4, "Scheduled Procedure Step ID", "EI", R),
fld!(5, "Modality", "CE", O),
fld!(6, "Protocol Code", "CE", O, rep),
fld!(7, "Scheduled Station Name", "EI", O),
fld!(8, "Scheduled Procedure Step Location", "CE", O, rep),
fld!(9, "Scheduled AE Title", "ST", O),
];
const LAN: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Language Code", "CE", R),
fld!(3, "Language Ability Code", "CE", O, rep),
fld!(4, "Language Proficiency Code", "CE", O),
];
const LCC: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "PL", R),
fld!(2, "Location Department", "CE", R),
fld!(3, "Accommodation Type", "CE", O, rep),
fld!(4, "Charge Code", "CE", R, rep),
];
const LCH: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "PL", R),
fld!(2, "Segment Action Code", "ID", O, t "0206"),
fld!(3, "Segment Unique Key", "EI", O),
fld!(4, "Location Characteristic ID", "CE", R),
fld!(5, "Location Characteristic Value", "CE", R),
];
const LDP: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "PL", R),
fld!(2, "Location Department", "CE", R),
fld!(3, "Location Service", "IS", O, rep),
fld!(4, "Specialty Type", "CE", O, rep),
fld!(5, "Valid Patient Classes", "IS", O, t "0004", rep),
fld!(6, "Active/Inactive Flag", "ID", O),
fld!(7, "Activation Date LDP", "TS", O),
fld!(8, "Inactivation Date", "TS", O),
fld!(9, "Inactivated Reason", "ST", O),
fld!(10, "Visiting Hours", "VH", O, rep),
fld!(11, "Contact Phone", "XTN", O),
fld!(12, "Location Cost Center", "CE", O),
];
const LOC: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "PL", R),
fld!(2, "Location Description", "ST", O),
fld!(3, "Location Type", "IS", R, rep),
fld!(4, "Organization Name", "XON", O, rep),
fld!(5, "Location Address", "XAD", O, rep),
fld!(6, "Location Phone", "XTN", O, rep),
fld!(7, "License Number", "CE", O, rep),
fld!(8, "Location Equipment", "IS", O, rep),
fld!(9, "Location Service Code", "IS", O),
];
const LRL: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "PL", R),
fld!(2, "Segment Action Code", "ID", O, t "0206"),
fld!(3, "Segment Unique Key", "EI", O),
fld!(4, "Location Relationship ID", "CE", R),
fld!(
5,
"Organizational Location Relationship Value",
"XON",
O,
rep
),
fld!(6, "Patient Location Relationship Value", "PL", O),
];
const MFA: &[FieldSpec] = &[
fld!(1, "Record-Level Event Code", "ID", R),
fld!(2, "MFN Control ID", "ST", O),
fld!(3, "Event Completion Date/Time", "TS", O),
fld!(4, "MFN Record Level Error Return", "CE", R),
fld!(5, "Primary Key Value", "VARIES", R, rep),
fld!(6, "Primary Key Value Type", "ID", R, rep),
];
const MFE: &[FieldSpec] = &[
fld!(1, "Record-Level Event Code", "ID", R),
fld!(2, "MFN Control ID", "ST", O),
fld!(3, "Effective Date/Time", "TS", O),
fld!(4, "Primary Key Value", "VARIES", R, rep),
fld!(5, "Primary Key Value Type", "ID", R, rep),
];
const MFI: &[FieldSpec] = &[
fld!(1, "Master File Identifier", "CE", R),
fld!(2, "Master File Application Identifier", "HD", O),
fld!(3, "File-Level Event Code", "ID", R),
fld!(4, "Entered Date/Time", "TS", O),
fld!(5, "Effective Date/Time", "TS", O),
fld!(6, "Response Level Code", "ID", R),
];
const NPU: &[FieldSpec] = &[
fld!(1, "Bed Location", "PL", R),
fld!(2, "Bed Status", "IS", O),
];
const ODT: &[FieldSpec] = &[
fld!(1, "Tray Type", "CE", R),
fld!(2, "Service Period", "CE", O, rep),
fld!(3, "Text Instruction", "ST", O),
];
const OM1: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", R),
fld!(2, "Producer's Service/Test/Observation ID", "CE", R),
fld!(3, "Permitted Data Types", "ID", O, t "0125", rep),
fld!(4, "Specimen Required", "ID", R, t "0136"),
fld!(5, "Producer ID", "CE", R),
fld!(6, "Observation Description", "TX", O),
fld!(
7,
"Other Service/Test/Observation IDs for the Observation",
"CE",
O
),
fld!(8, "Other Names", "ST", R, rep),
fld!(9, "Preferred Report Name for the Observation", "ST", O),
fld!(
10,
"Preferred Short Name or Mnemonic for Observation",
"ST",
O
),
fld!(11, "Preferred Long Name for the Observation", "ST", O),
fld!(12, "Orderability", "ID", O, t "0136"),
fld!(
13,
"Identity of Instrument Used to Perform this Study",
"CE",
O,
rep
),
fld!(14, "Coded Representation of Method", "CE", O, rep),
fld!(15, "Portable Device Indicator", "ID", O, t "0136"),
fld!(16, "Observation Producing Department/Section", "CE", O, rep),
fld!(17, "Telephone Number of Section", "XTN", O),
fld!(18, "Nature of Service/Test/Observation", "IS", R),
fld!(19, "Report Subheader", "CE", O),
fld!(20, "Report Display Order", "ST", O),
fld!(
21,
"Date/Time Stamp for any change in Definition for the Observation",
"TS",
O
),
fld!(22, "Effective Date/Time of Change", "TS", O),
fld!(23, "Typical Turn-Around Time", "NM", O),
fld!(24, "Processing Time", "NM", O),
fld!(25, "Processing Priority", "ID", O, rep),
fld!(26, "Reporting Priority", "ID", O),
fld!(
27,
"Outside Site(s) Where Observation may be Performed",
"CE",
O,
rep
),
fld!(28, "Address of Outside Site(s)", "XAD", O, rep),
fld!(29, "Phone Number of Outside Site", "XTN", O),
fld!(30, "Confidentiality Code", "CWE", O),
fld!(
31,
"Observations Required to Interpret the Observation",
"CE",
O
),
fld!(32, "Interpretation of Observations", "TX", O),
fld!(33, "Contraindications to Observations", "CE", O),
fld!(34, "Reflex Tests/Observations", "CE", O, rep),
fld!(35, "Rules that Trigger Reflex Testing", "TX", O),
fld!(36, "Fixed Canned Message", "CE", O),
fld!(37, "Patient Preparation", "TX", O),
fld!(38, "Procedure Medication", "CE", O),
fld!(39, "Factors that may Affect the Observation", "TX", O),
fld!(
40,
"Service/Test/Observation Performance Schedule",
"ST",
O,
rep
),
fld!(41, "Description of Test Methods", "TX", O),
fld!(42, "Kind of Quantity Observed", "CE", O),
fld!(43, "Point Versus Interval", "CE", O),
fld!(44, "Challenge Information", "TX", O),
fld!(45, "Relationship Modifier", "CE", O),
fld!(46, "Target Anatomic Site Of Test", "CE", O),
fld!(47, "Modality Of Imaging Measurement", "CE", O),
];
const OM2: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", O),
fld!(2, "Units of Measure", "CE", O),
fld!(3, "Range of Decimal Precision", "NM", O, rep),
fld!(4, "Corresponding SI Units of Measure", "CE", O),
fld!(5, "SI Conversion Factor", "TX", O),
fld!(
6,
"Reference (Normal) Range - Ordinal and Continuous Observations",
"RFR",
O,
rep
),
fld!(
7,
"Critical Range for Ordinal and Continuous Observations",
"RFR",
O,
rep
),
fld!(
8,
"Absolute Range for Ordinal and Continuous Observations",
"RFR",
O
),
fld!(9, "Delta Check Criteria", "DLT", O, rep),
fld!(10, "Minimum Meaningful Increments", "NM", O),
];
const OM3: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", O),
fld!(2, "Preferred Coding System", "CE", O),
fld!(3, "Valid Coded 'Answers'", "CE", O),
fld!(
4,
"Normal Text/Codes for Categorical Observations",
"CE",
O,
rep
),
fld!(
5,
"Abnormal Text/Codes for Categorical Observations",
"CE",
O,
rep
),
fld!(
6,
"Critical Text/Codes for Categorical Observations",
"CE",
O,
rep
),
fld!(7, "Value Type", "ID", O, t "0125"),
];
const OM4: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", O),
fld!(2, "Derived Specimen", "ID", O),
fld!(3, "Container Description", "TX", O),
fld!(4, "Container Volume", "NM", O),
fld!(5, "Container Units", "CE", O),
fld!(6, "Specimen", "CE", O),
fld!(7, "Additive", "CWE", O),
fld!(8, "Preparation", "TX", O),
fld!(9, "Special Handling Requirements", "TX", O),
fld!(10, "Normal Collection Volume", "CQ", O),
fld!(11, "Minimum Collection Volume", "CQ", O),
fld!(12, "Specimen Requirements", "TX", O),
fld!(13, "Specimen Priorities", "ID", O, rep),
fld!(14, "Specimen Retention Time", "CQ", O),
];
const OM5: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", O),
fld!(
2,
"Test/Observations Included within an Ordered Test Battery",
"CE",
O,
rep
),
fld!(3, "Observation ID Suffixes", "ST", O),
];
const OM6: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", O),
fld!(2, "Derivation Rule", "TX", O),
];
const OM7: &[FieldSpec] = &[
fld!(1, "Sequence Number - Test/Observation Master File", "NM", R),
fld!(2, "Universal Service Identifier", "CE", R),
fld!(3, "Category Identifier", "CE", O, rep),
fld!(4, "Category Description", "TX", O),
fld!(5, "Category Synonym", "ST", O, rep),
fld!(6, "Effective Test/Service Start Date/Time", "TS", O),
fld!(7, "Effective Test/Service End Date/Time", "TS", O),
fld!(8, "Test/Service Default Duration Quantity", "NM", O),
fld!(9, "Test/Service Default Duration Units", "CE", O),
fld!(10, "Test/Service Default Frequency", "IS", O),
fld!(11, "Consent Indicator", "ID", O, t "0136"),
fld!(12, "Consent Identifier", "CE", O),
fld!(13, "Consent Effective Start Date/Time", "TS", O),
fld!(14, "Consent Effective End Date/Time", "TS", O),
fld!(15, "Consent Interval Quantity", "NM", O),
fld!(16, "Consent Interval Units", "CE", O),
fld!(17, "Consent Waiting Period Quantity", "NM", O),
fld!(18, "Consent Waiting Period Units", "CE", O),
fld!(19, "Effective Date/Time of Change", "TS", O),
fld!(20, "Entered By", "XCN", O),
fld!(21, "Orderable-at Location", "PL", O, rep),
fld!(22, "Formulary Status", "IS", O),
fld!(23, "Special Order Indicator", "ID", O, t "0136"),
fld!(24, "Primary Key Value - CDM", "CE", O, rep),
];
const ORG: &[FieldSpec] = &[
fld!(1, "Set ID", "SI", R),
fld!(2, "Organization Unit Code", "CE", O),
fld!(3, "Organization Unit Type Code", "CE", O),
fld!(4, "Primary Org Unit Indicator", "ID", O, t "0136"),
fld!(5, "Practitioner Org Unit Identifier", "CX", O),
fld!(6, "Health Care Provider Type Code", "CE", O),
fld!(7, "Health Care Provider Classification Code", "CE", O),
fld!(
8,
"Health Care Provider Area of Specialization Code",
"CE",
O
),
fld!(9, "Effective Date Range", "DR", O),
fld!(10, "Employment Status Code", "CE", O),
fld!(11, "Board Approval Indicator", "ID", O, t "0136"),
fld!(12, "Primary Care Physician Indicator", "ID", O, t "0136"),
];
const OVR: &[FieldSpec] = &[
fld!(1, "Business Rule Override Type", "CWE", O),
fld!(2, "Business Rule Override Code", "CWE", O),
fld!(3, "Override Comments", "TX", O),
fld!(4, "Override Entered By", "XCN", O),
fld!(5, "Override Authorized By", "XCN", O),
];
const PCR: &[FieldSpec] = &[
fld!(1, "Implicated Product", "CE", R),
fld!(2, "Generic Product", "IS", O),
fld!(3, "Product Class", "CE", O),
fld!(4, "Total Duration Of Therapy", "CQ", O),
fld!(5, "Product Manufacture Date", "TS", O),
fld!(6, "Product Expiration Date", "TS", O),
fld!(7, "Product Implantation Date", "TS", O),
fld!(8, "Product Explantation Date", "TS", O),
fld!(9, "Single Use Device", "IS", O),
fld!(10, "Indication For Product Use", "CE", O),
fld!(11, "Product Problem", "IS", O),
fld!(12, "Product Serial/Lot Number", "ST", O, rep),
fld!(13, "Product Available For Inspection", "IS", O),
fld!(14, "Product Evaluation Performed", "CE", O),
fld!(15, "Product Evaluation Status", "CE", O),
fld!(16, "Product Evaluation Results", "CE", O),
fld!(17, "Evaluated Product Source", "ID", O),
fld!(18, "Date Product Returned To Manufacturer", "TS", O),
fld!(19, "Device Operator Qualifications", "ID", O),
fld!(20, "Relatedness Assessment", "ID", O),
fld!(21, "Action Taken In Response To The Event", "ID", O, rep),
fld!(22, "Event Causality Observations", "ID", O, rep),
fld!(23, "Indirect Exposure Mechanism", "ID", O, rep),
];
const PDC: &[FieldSpec] = &[
fld!(1, "Manufacturer/Distributor", "XON", R, rep),
fld!(2, "Country", "CE", R),
fld!(3, "Brand Name", "ST", R),
fld!(4, "Device Family Name", "ST", O),
fld!(5, "Generic Name", "CE", O),
fld!(6, "Model Identifier", "ST", O, rep),
fld!(7, "Catalogue Identifier", "ST", O),
fld!(8, "Other Identifier", "ST", O, rep),
fld!(9, "Product Code", "CE", O),
fld!(10, "Marketing Basis", "ID", O),
fld!(11, "Marketing Approval ID", "ST", O),
fld!(12, "Labeled Shelf Life", "CQ", O),
fld!(13, "Expected Shelf Life", "CQ", O),
fld!(14, "Date First Marketed", "TS", O),
fld!(15, "Date Last Marketed", "TS", O),
];
const PEO: &[FieldSpec] = &[
fld!(1, "Event Identifiers Used", "CE", O, rep),
fld!(2, "Event Symptom/Diagnosis Code", "CE", O, rep),
fld!(3, "Event Onset Date/Time", "TS", R),
fld!(4, "Event Exacerbation Date/Time", "TS", O),
fld!(5, "Event Improved Date/Time", "TS", O),
fld!(6, "Event Ended Data/Time", "TS", O),
fld!(7, "Event Location Occurred Address", "XAD", O, rep),
fld!(8, "Event Qualification", "ID", O, rep),
fld!(9, "Event Serious", "ID", O),
fld!(10, "Event Expected", "ID", O),
fld!(11, "Event Outcome", "ID", O, rep),
fld!(12, "Patient Outcome", "ID", O),
fld!(13, "Event Description From Others", "FT", O, rep),
fld!(14, "Event From Original Reporter", "FT", O, rep),
fld!(15, "Event Description From Patient", "FT", O, rep),
fld!(16, "Event Description From Practitioner", "FT", O, rep),
fld!(17, "Event Description From Autopsy", "FT", O, rep),
fld!(18, "Cause Of Death", "CE", O, rep),
fld!(19, "Primary Observer Name", "XPN", O, rep),
fld!(20, "Primary Observer Address", "XAD", O, rep),
fld!(21, "Primary Observer Telephone", "XTN", O, rep),
fld!(22, "Primary Observer's Qualification", "ID", O),
fld!(23, "Confirmation Provided By", "ID", O),
fld!(24, "Primary Observer Aware Date/Time", "TS", O),
fld!(25, "Primary Observer's identity May Be Divulged", "ID", O),
];
const PES: &[FieldSpec] = &[
fld!(1, "Sender Organization Name", "XON", O, rep),
fld!(2, "Sender Individual Name", "XCN", O, rep),
fld!(3, "Sender Address", "XAD", O, rep),
fld!(4, "Sender Telephone", "XTN", O, rep),
fld!(5, "Sender Event Identifier", "EI", O),
fld!(6, "Sender Sequence Number", "NM", O),
fld!(7, "Sender Event Description", "FT", O, rep),
fld!(8, "Sender Comment", "FT", O),
fld!(9, "Sender Aware Date/Time", "TS", O),
fld!(10, "Event Report Date", "TS", R),
fld!(11, "Event Report Timing/Type", "ID", O, rep),
fld!(12, "Event Report Source", "ID", O),
fld!(13, "Event Reported To", "ID", O, rep),
];
const PRA: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "CE", O),
fld!(2, "Practitioner Group", "CE", O, rep),
fld!(3, "Practitioner Category", "IS", O, rep),
fld!(4, "Provider Billing", "ID", O),
fld!(5, "Specialty", "SPD", O, rep),
fld!(6, "Practitioner ID Numbers", "PLN", B, rep),
fld!(7, "Privileges", "PIP", O, rep),
fld!(8, "Date Entered Practice", "DT", O),
fld!(9, "Institution", "CE", O),
fld!(10, "Date Left Practice", "DT", O),
fld!(
11,
"Government Reimbursement Billing Eligibility",
"CE",
O,
rep
),
fld!(12, "Set ID", "SI", O),
];
const PRB: &[FieldSpec] = &[
fld!(1, "Action Code", "ID", R),
fld!(2, "Action Date/Time", "TS", R),
fld!(3, "Problem ID", "CE", R),
fld!(4, "Problem Instance ID", "EI", R),
fld!(5, "Episode of Care ID", "EI", O),
fld!(6, "Problem List Priority", "NM", O),
fld!(7, "Problem Established Date/Time", "TS", O),
fld!(8, "Anticipated Problem Resolution Date/Time", "TS", O),
fld!(9, "Actual Problem Resolution Date/Time", "TS", O),
fld!(10, "Problem Classification", "CE", O),
fld!(11, "Problem Management Discipline", "CE", O, rep),
fld!(12, "Problem Persistence", "CE", O),
fld!(13, "Problem Confirmation Status", "CE", O),
fld!(14, "Problem Life Cycle Status", "CE", O),
fld!(15, "Problem Life Cycle Status Date/Time", "TS", O),
fld!(16, "Problem Date of Onset", "TS", O),
fld!(17, "Problem Onset Text", "ST", O),
fld!(18, "Problem Ranking", "CE", O),
fld!(19, "Certainty of Problem", "CE", O),
fld!(20, "Probability of Problem (0-1)", "NM", O),
fld!(21, "Individual Awareness of Problem", "CE", O),
fld!(22, "Problem Prognosis", "CE", O),
fld!(23, "Individual Awareness of Prognosis", "CE", O),
fld!(
24,
"Family/Significant Other Awareness of Problem/Prognosis",
"ST",
O
),
fld!(25, "Security/Sensitivity", "CE", O),
];
const PRC: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "CE", R),
fld!(2, "Facility ID", "CE", O, rep),
fld!(3, "Department", "CE", O, rep),
fld!(4, "Valid Patient Classes", "IS", O, t "0004", rep),
fld!(5, "Price", "CP", O, rep),
fld!(6, "Formula", "ST", O, rep),
fld!(7, "Minimum Quantity", "NM", O),
fld!(8, "Maximum Quantity", "NM", O),
fld!(9, "Minimum Price", "MO", O),
fld!(10, "Maximum Price", "MO", O),
fld!(11, "Effective Start Date", "TS", O),
fld!(12, "Effective End Date", "TS", O),
fld!(13, "Price Override Flag", "IS", O),
fld!(14, "Billing Category", "CE", O, rep),
fld!(15, "Chargeable Flag", "ID", O, t "0136"),
fld!(16, "Active/Inactive Flag", "ID", O),
fld!(17, "Cost", "MO", O),
fld!(18, "Charge On Indicator", "IS", O),
];
const PRD: &[FieldSpec] = &[
fld!(1, "Provider Role", "CE", R, rep),
fld!(2, "Provider Name", "XPN", O, rep),
fld!(3, "Provider Address", "XAD", O, rep),
fld!(4, "Provider Location", "PL", O),
fld!(5, "Provider Communication Information", "XTN", O, rep),
fld!(6, "Preferred Method of Contact", "CE", O),
fld!(7, "Provider Identifiers", "PLN", O, rep),
fld!(8, "Effective Start Date of Provider Role", "TS", O),
fld!(9, "Effective End Date of Provider Role", "TS", O),
];
const PSH: &[FieldSpec] = &[
fld!(1, "Report Type", "ST", R),
fld!(2, "Report Form Identifier", "ST", O),
fld!(3, "Report Date", "TS", R),
fld!(4, "Report Interval Start Date", "TS", O),
fld!(5, "Report Interval End Date", "TS", O),
fld!(6, "Quantity Manufactured", "CQ", O),
fld!(7, "Quantity Distributed", "CQ", O),
fld!(8, "Quantity Distributed Method", "ID", O),
fld!(9, "Quantity Distributed Comment", "FT", O),
fld!(10, "Quantity in Use", "CQ", O),
fld!(11, "Quantity in Use Method", "ID", O),
fld!(12, "Quantity in Use Comment", "FT", O),
fld!(
13,
"Number of Product Experience Reports Filed by Facility",
"NM",
O,
rep
),
fld!(
14,
"Number of Product Experience Reports Filed by Distributor",
"NM",
O,
rep
),
];
const PTH: &[FieldSpec] = &[
fld!(1, "Action Code", "ID", R),
fld!(2, "Pathway ID", "CE", R),
fld!(3, "Pathway Instance ID", "EI", R),
fld!(4, "Pathway Established Date/Time", "TS", R),
fld!(5, "Pathway Life Cycle Status", "CE", O),
fld!(6, "Change Pathway Life Cycle Status Date/Time", "TS", O),
];
const QAK: &[FieldSpec] = &[
fld!(1, "Query Tag", "ST", O),
fld!(2, "Query Response Status", "ID", O),
fld!(3, "Message Query Name", "CE", O),
fld!(4, "Hit Count", "NM", O),
fld!(5, "This payload", "NM", O),
fld!(6, "Hits remaining", "NM", O),
];
const QPD: &[FieldSpec] = &[
fld!(1, "Message Query Name", "CE", R),
fld!(2, "Query Tag", "ST", O),
];
const QRF: &[FieldSpec] = &[
fld!(1, "Where Subject Filter", "ST", R, rep),
fld!(2, "When Data Start Date/Time", "TS", B),
fld!(3, "When Data End Date/Time", "TS", B),
fld!(4, "What User Qualifier", "ST", O, rep),
fld!(5, "Other QRY Subject Filter", "ST", O, rep),
fld!(6, "Which Date/Time Qualifier", "ID", O, rep),
fld!(7, "Which Date/Time Status Qualifier", "ID", O, rep),
fld!(8, "Date/Time Selection Qualifier", "ID", O, rep),
fld!(9, "When Quantity/Timing Qualifier", "TQ", O),
fld!(10, "Search Confidence Threshold", "NM", O),
];
const RCP: &[FieldSpec] = &[
fld!(1, "Query Priority", "ID", O, t "0091"),
fld!(2, "Quantity Limited Request", "CQ", O),
fld!(3, "Response Modality", "CE", O),
fld!(4, "Execution and Delivery Time", "TS", O),
fld!(5, "Modify Indicator", "ID", O),
fld!(6, "Sort-by Field", "SRT", O, rep),
fld!(7, "Segment group inclusion", "ID", O, rep),
];
const RF1: &[FieldSpec] = &[
fld!(1, "Referral Status", "CE", O),
fld!(2, "Referral Priority", "CE", O),
fld!(3, "Referral Type", "CE", O),
fld!(4, "Referral Disposition", "CE", O, rep),
fld!(5, "Referral Category", "CE", O),
fld!(6, "Originating Referral Identifier", "EI", R),
fld!(7, "Effective Date", "TS", O),
fld!(8, "Expiration Date", "TS", O),
fld!(9, "Process Date", "TS", O),
fld!(10, "Referral Reason", "CE", O, rep),
fld!(11, "External Referral Identifier", "EI", O, rep),
];
const RMI: &[FieldSpec] = &[
fld!(1, "Risk Management Incident Code", "CE", O),
fld!(2, "Date/Time Incident", "TS", O),
fld!(3, "Incident Type Code", "CE", O),
];
const RQ1: &[FieldSpec] = &[
fld!(1, "Anticipated Price", "ST", O),
fld!(2, "Manufacturer Identifier", "CE", O),
fld!(3, "Manufacturer's Catalog", "ST", O),
fld!(4, "Vendor ID", "CE", O),
fld!(5, "Vendor Catalog", "ST", O),
fld!(6, "Taxable", "ID", O, t "0136"),
fld!(7, "Substitute Allowed", "ID", O, t "0136"),
];
const RXD: &[FieldSpec] = &[
fld!(1, "Dispense Sub-ID Counter", "NM", R),
fld!(2, "Dispense/Give Code", "CE", R),
fld!(3, "Date/Time Dispensed", "TS", R),
fld!(4, "Actual Dispense Amount", "NM", R),
fld!(5, "Actual Dispense Units", "CE", O),
fld!(6, "Actual Dosage Form", "CE", O),
fld!(7, "Prescription Number", "ST", R),
fld!(8, "Number of Refills Remaining", "NM", O),
fld!(9, "Dispense Notes", "ST", O, rep),
fld!(10, "Dispensing Provider", "XCN", O, rep),
fld!(11, "Substitution Status", "ID", O),
fld!(12, "Total Daily Dose", "CQ", O),
fld!(13, "Dispense-to Location", "LA2", O),
fld!(14, "Needs Human Review", "ID", O, t "0136"),
fld!(
15,
"Pharmacy/Treatment Supplier's Special Dispensing Instructions",
"CE",
O,
rep
),
fld!(16, "Actual Strength", "NM", O),
fld!(17, "Actual Strength Unit", "CE", O),
fld!(18, "Substance Lot Number", "ST", O, rep),
fld!(19, "Substance Expiration Date", "TS", O, rep),
fld!(20, "Substance Manufacturer Name", "CE", O, rep),
fld!(21, "Indication", "CE", O, rep),
fld!(22, "Dispense Package Size", "NM", O),
fld!(23, "Dispense Package Size Unit", "CE", O),
fld!(24, "Dispense Package Method", "ID", O),
fld!(25, "Supplementary Code", "CE", O, rep),
fld!(26, "Initiating Location", "CE", O),
fld!(27, "Packaging/Assembly Location", "CE", O),
fld!(28, "Actual Drug Strength Volume", "NM", O),
fld!(29, "Actual Drug Strength Volume Units", "CWE", O),
fld!(30, "Dispense to Pharmacy", "CWE", O),
fld!(31, "Dispense to Pharmacy Address", "XAD", O),
fld!(32, "Pharmacy Order Type", "ID", O),
fld!(33, "Dispense Type", "CWE", O),
];
const RXG: &[FieldSpec] = &[
fld!(1, "Give Sub-ID Counter", "NM", R),
fld!(2, "Dispense Sub-ID Counter", "NM", O),
fld!(3, "Quantity/Timing", "TQ", B),
fld!(4, "Give Code", "CE", R),
fld!(5, "Give Amount - Minimum", "NM", R),
fld!(6, "Give Amount - Maximum", "NM", O),
fld!(7, "Give Units", "CE", R),
fld!(8, "Give Dosage Form", "CE", O),
fld!(9, "Administration Notes", "CE", O, rep),
fld!(10, "Substitution Status", "ID", O),
fld!(11, "Dispense-To Location", "LA2", O),
fld!(12, "Needs Human Review", "ID", O, t "0136"),
fld!(
13,
"Pharmacy/Treatment Supplier's Special Administration Instructions",
"CE",
O,
rep
),
fld!(14, "Give Per (Time Unit)", "ST", O),
fld!(15, "Give Rate Amount", "ST", O),
fld!(16, "Give Rate Units", "CE", O),
fld!(17, "Give Strength", "NM", O),
fld!(18, "Give Strength Units", "CE", O),
fld!(19, "Substance Lot Number", "ST", O, rep),
fld!(20, "Substance Expiration Date", "TS", O, rep),
fld!(21, "Substance Manufacturer Name", "CE", O, rep),
fld!(22, "Indication", "CE", O, rep),
fld!(23, "Give Drug Strength Volume", "NM", O),
fld!(24, "Give Drug Strength Volume Units", "CWE", O),
fld!(25, "Give Barcode Identifier", "CWE", O),
fld!(26, "Pharmacy Order Type", "ID", O),
];
const STF: &[FieldSpec] = &[
fld!(1, "Primary Key Value", "CE", O),
fld!(2, "Staff Identifier List", "CX", O, rep),
fld!(3, "Staff Name", "XPN", O, rep),
fld!(4, "Staff Type", "IS", O, rep),
fld!(5, "Administrative Sex", "IS", O, t "0001"),
fld!(6, "Date/Time of Birth", "TS", O),
fld!(7, "Active/Inactive Flag", "ID", O),
fld!(8, "Department", "CE", O, rep),
fld!(9, "Hospital Service", "CE", O, rep),
fld!(10, "Phone", "XTN", O, rep),
fld!(11, "Office/Home Address/Birthplace", "XAD", O, rep),
fld!(12, "Institution Activation Date", "DIN", O, rep),
fld!(13, "Institution Inactivation Date", "DIN", O, rep),
fld!(14, "Backup Person ID", "CE", O, rep),
fld!(15, "E-Mail Address", "ST", O, rep),
fld!(16, "Preferred Method of Contact", "CE", O),
fld!(17, "Marital Status", "CE", O, t "0002"),
fld!(18, "Job Title", "ST", O),
fld!(19, "Job Code/Class", "JCC", O),
fld!(20, "Employment Status Code", "CE", O),
fld!(21, "Additional Insured on Auto", "ID", O, t "0136"),
fld!(22, "Driver's License Number - Staff", "DLN", O),
fld!(23, "Copy Auto Ins", "ID", O, t "0136"),
fld!(24, "Auto Ins. Expires", "DT", O),
fld!(25, "Date Last DMV Review", "DT", O),
fld!(26, "Date Next DMV Review", "DT", O),
fld!(27, "Race", "CE", O),
fld!(28, "Ethnic Group", "CE", O, t "0189"),
fld!(29, "Re-activation Approval Indicator", "ID", O, t "0136"),
fld!(30, "Citizenship", "CWE", O, rep),
fld!(31, "Death Date and Time", "TS", O),
fld!(32, "Death Indicator", "ID", O, t "0136"),
fld!(33, "Institution Relationship Type Code", "CWE", O),
fld!(34, "Institution Relationship Period", "DR", O),
fld!(35, "Expected Return Date", "DT", O),
fld!(36, "Cost Center Code", "CWE", O, rep),
fld!(37, "Generic Classification Indicator", "ID", O, t "0136"),
fld!(38, "Inactive Reason Code", "CWE", O),
];
const URD: &[FieldSpec] = &[
fld!(1, "R/U Date/Time", "TS", O),
fld!(2, "Report Priority", "ID", O),
fld!(3, "R/U Who Subject Definition", "XCN", R, rep),
fld!(4, "R/U What Subject Definition", "CE", O, rep),
fld!(5, "R/U What Department Code", "CE", O, rep),
fld!(6, "R/U Display/Print Locations", "ST", O, rep),
fld!(7, "R/U Results Level", "ID", O),
];
const URS: &[FieldSpec] = &[
fld!(1, "R/U Where Subject Definition", "ST", R, rep),
fld!(2, "R/U When Data Start Date/Time", "TS", O),
fld!(3, "R/U When Data End Date/Time", "TS", O),
fld!(4, "R/U What User Qualifier", "ST", O, rep),
fld!(5, "R/U Other Results Subject Definition", "ST", O, rep),
fld!(6, "R/U Which Date/Time Qualifier", "ID", O, rep),
fld!(7, "R/U Which Date/Time Status Qualifier", "ID", O, rep),
fld!(8, "R/U Date/Time Selection Qualifier", "ID", O, rep),
fld!(9, "R/U Quantity/Timing Qualifier", "TQ", O),
];
const VAR: &[FieldSpec] = &[
fld!(1, "Variance Instance ID", "EI", R),
fld!(2, "Documented Date/Time", "TS", R),
fld!(3, "Stated Variance Date/Time", "TS", O),
fld!(4, "Variance Originator", "XCN", O, rep),
fld!(5, "Variance Classification", "CE", O),
fld!(6, "Variance Description", "ST", O, rep),
];
const ZL7: &[FieldSpec] = &[
fld!(1, "Primary key value", "CE", R),
fld!(2, "Display-sort-key", "NM", R),
];
const SEGMENTS: &[SegmentSpec] = &[
SegmentSpec {
name: "ABS",
desc: "Abstract",
fields: ABS,
},
SegmentSpec {
name: "ACC",
desc: "Accident",
fields: ACC,
},
SegmentSpec {
name: "AFF",
desc: "Professional Affiliation",
fields: AFF,
},
SegmentSpec {
name: "AIG",
desc: "Appointment Information - General Resource",
fields: AIG,
},
SegmentSpec {
name: "AIL",
desc: "Appointment Information - Location",
fields: AIL,
},
SegmentSpec {
name: "AIP",
desc: "Appointment Information - Personnel",
fields: AIP,
},
SegmentSpec {
name: "AIS",
desc: "Appointment Information - Service",
fields: AIS,
},
SegmentSpec {
name: "AL1",
desc: "Patient Allergy Information",
fields: AL1,
},
SegmentSpec {
name: "APR",
desc: "Appointment Preferences",
fields: APR,
},
SegmentSpec {
name: "ARQ",
desc: "Appointment Request",
fields: ARQ,
},
SegmentSpec {
name: "AUT",
desc: "Authorization Information",
fields: AUT,
},
SegmentSpec {
name: "BHS",
desc: "Batch Header",
fields: BHS,
},
SegmentSpec {
name: "BLC",
desc: "Blood Code",
fields: BLC,
},
SegmentSpec {
name: "BLG",
desc: "Billing",
fields: BLG,
},
SegmentSpec {
name: "BPO",
desc: "Blood product order",
fields: BPO,
},
SegmentSpec {
name: "BPX",
desc: "Blood product dispense status",
fields: BPX,
},
SegmentSpec {
name: "BTS",
desc: "Batch Trailer",
fields: BTS,
},
SegmentSpec {
name: "BTX",
desc: "Blood Product Transfusion/Disposition",
fields: BTX,
},
SegmentSpec {
name: "CDM",
desc: "Charge Description Master",
fields: CDM,
},
SegmentSpec {
name: "CER",
desc: "Certificate Detail",
fields: CER,
},
SegmentSpec {
name: "CM0",
desc: "Clinical Study Master",
fields: CM0,
},
SegmentSpec {
name: "CM1",
desc: "Clinical Study Phase Master",
fields: CM1,
},
SegmentSpec {
name: "CM2",
desc: "Clinical Study Schedule Master",
fields: CM2,
},
SegmentSpec {
name: "CON",
desc: "Consent Segment",
fields: CON,
},
SegmentSpec {
name: "CSP",
desc: "Clinical Study Phase",
fields: CSP,
},
SegmentSpec {
name: "CSR",
desc: "Clinical Study Registration",
fields: CSR,
},
SegmentSpec {
name: "CSS",
desc: "Clinical Study Data Schedule Segment",
fields: CSS,
},
SegmentSpec {
name: "CTD",
desc: "Contact Data",
fields: CTD,
},
SegmentSpec {
name: "CTI",
desc: "Clinical Trial Identification",
fields: CTI,
},
SegmentSpec {
name: "DB1",
desc: "Disability",
fields: DB1,
},
SegmentSpec {
name: "DG1",
desc: "Diagnosis",
fields: DG1,
},
SegmentSpec {
name: "DRG",
desc: "Diagnosis Related Group",
fields: DRG,
},
SegmentSpec {
name: "DSC",
desc: "Continuation Pointer",
fields: DSC,
},
SegmentSpec {
name: "EDU",
desc: "Educational Detail",
fields: EDU,
},
SegmentSpec {
name: "ERR",
desc: "Error",
fields: ERR,
},
SegmentSpec {
name: "EVN",
desc: "Event Type",
fields: EVN,
},
SegmentSpec {
name: "FAC",
desc: "Facility",
fields: FAC,
},
SegmentSpec {
name: "FHS",
desc: "File Header",
fields: FHS,
},
SegmentSpec {
name: "FT1",
desc: "Financial Transaction",
fields: FT1,
},
SegmentSpec {
name: "FTS",
desc: "File Trailer",
fields: FTS,
},
SegmentSpec {
name: "GOL",
desc: "Goal Detail",
fields: GOL,
},
SegmentSpec {
name: "GP1",
desc: "Grouping/Reimbursement - Visit",
fields: GP1,
},
SegmentSpec {
name: "GP2",
desc: "Grouping/Reimbursement - Procedure Line Item",
fields: GP2,
},
SegmentSpec {
name: "GT1",
desc: "Guarantor",
fields: GT1,
},
SegmentSpec {
name: "IAM",
desc: "Patient Adverse Reaction Information",
fields: IAM,
},
SegmentSpec {
name: "IIM",
desc: "Inventory Item Master",
fields: IIM,
},
SegmentSpec {
name: "IN1",
desc: "Insurance",
fields: IN1,
},
SegmentSpec {
name: "IN2",
desc: "Insurance Additional Information",
fields: IN2,
},
SegmentSpec {
name: "IN3",
desc: "Insurance Additional Information, Certification",
fields: IN3,
},
SegmentSpec {
name: "IPC",
desc: "Imaging Procedure Control Segment",
fields: IPC,
},
SegmentSpec {
name: "LAN",
desc: "Language Detail",
fields: LAN,
},
SegmentSpec {
name: "LCC",
desc: "Location Charge Code",
fields: LCC,
},
SegmentSpec {
name: "LCH",
desc: "Location Characteristic",
fields: LCH,
},
SegmentSpec {
name: "LDP",
desc: "Location Department",
fields: LDP,
},
SegmentSpec {
name: "LOC",
desc: "Location Identification",
fields: LOC,
},
SegmentSpec {
name: "LRL",
desc: "Location Relationship",
fields: LRL,
},
SegmentSpec {
name: "MFA",
desc: "Master File Acknowledgment",
fields: MFA,
},
SegmentSpec {
name: "MFE",
desc: "Master File Entry",
fields: MFE,
},
SegmentSpec {
name: "MFI",
desc: "Master File Identification",
fields: MFI,
},
SegmentSpec {
name: "MRG",
desc: "Merge Patient Information",
fields: MRG,
},
SegmentSpec {
name: "MSA",
desc: "Message Acknowledgment",
fields: MSA,
},
SegmentSpec {
name: "MSH",
desc: "Message Header",
fields: MSH,
},
SegmentSpec {
name: "NK1",
desc: "Next of Kin / Associated Parties",
fields: NK1,
},
SegmentSpec {
name: "NPU",
desc: "Bed Status Update",
fields: NPU,
},
SegmentSpec {
name: "NTE",
desc: "Notes and Comments",
fields: NTE,
},
SegmentSpec {
name: "OBR",
desc: "Observation Request",
fields: OBR,
},
SegmentSpec {
name: "OBX",
desc: "Observation/Result",
fields: OBX,
},
SegmentSpec {
name: "ODS",
desc: "Dietary Orders, Supplements, and Preferences",
fields: ODS,
},
SegmentSpec {
name: "ODT",
desc: "Diet Tray Instructions",
fields: ODT,
},
SegmentSpec {
name: "OM1",
desc: "General Segment",
fields: OM1,
},
SegmentSpec {
name: "OM2",
desc: "Numeric Observation",
fields: OM2,
},
SegmentSpec {
name: "OM3",
desc: "Categorical Service/Test/Observation",
fields: OM3,
},
SegmentSpec {
name: "OM4",
desc: "Observations that Require Specimens",
fields: OM4,
},
SegmentSpec {
name: "OM5",
desc: "Observation Batteries (Sets)",
fields: OM5,
},
SegmentSpec {
name: "OM6",
desc: "Observations that are Calculated from Other Observations",
fields: OM6,
},
SegmentSpec {
name: "OM7",
desc: "Additional Basic Attributes",
fields: OM7,
},
SegmentSpec {
name: "ORC",
desc: "Common Order",
fields: ORC,
},
SegmentSpec {
name: "ORG",
desc: "Practitioner Organization Unit",
fields: ORG,
},
SegmentSpec {
name: "OVR",
desc: "Override Segment",
fields: OVR,
},
SegmentSpec {
name: "PCR",
desc: "Possible Causal Relationship",
fields: PCR,
},
SegmentSpec {
name: "PD1",
desc: "Patient Additional Demographic",
fields: PD1,
},
SegmentSpec {
name: "PDA",
desc: "Patient Death and Autopsy",
fields: PDA,
},
SegmentSpec {
name: "PDC",
desc: "Product Detail Country",
fields: PDC,
},
SegmentSpec {
name: "PEO",
desc: "Product Experience Observation",
fields: PEO,
},
SegmentSpec {
name: "PES",
desc: "Product Experience Sender",
fields: PES,
},
SegmentSpec {
name: "PID",
desc: "Patient Identification",
fields: PID,
},
SegmentSpec {
name: "PR1",
desc: "Procedures",
fields: PR1,
},
SegmentSpec {
name: "PRA",
desc: "Practitioner Detail",
fields: PRA,
},
SegmentSpec {
name: "PRB",
desc: "Problem Details",
fields: PRB,
},
SegmentSpec {
name: "PRC",
desc: "Pricing",
fields: PRC,
},
SegmentSpec {
name: "PRD",
desc: "Provider Data",
fields: PRD,
},
SegmentSpec {
name: "PSH",
desc: "Product Summary Header",
fields: PSH,
},
SegmentSpec {
name: "PTH",
desc: "Pathway",
fields: PTH,
},
SegmentSpec {
name: "PV1",
desc: "Patient Visit",
fields: PV1,
},
SegmentSpec {
name: "PV2",
desc: "Patient Visit - Additional Info",
fields: PV2,
},
SegmentSpec {
name: "QAK",
desc: "Query Acknowledgment",
fields: QAK,
},
SegmentSpec {
name: "QPD",
desc: "Query Parameter Definition",
fields: QPD,
},
SegmentSpec {
name: "QRD",
desc: "Original-Style Query Definition",
fields: QRD,
},
SegmentSpec {
name: "QRF",
desc: "Original Style Query Filter",
fields: QRF,
},
SegmentSpec {
name: "RCP",
desc: "Response Control Parameter",
fields: RCP,
},
SegmentSpec {
name: "RF1",
desc: "Referral Information",
fields: RF1,
},
SegmentSpec {
name: "RGS",
desc: "Resource Group",
fields: RGS,
},
SegmentSpec {
name: "RMI",
desc: "Risk Management Incident",
fields: RMI,
},
SegmentSpec {
name: "ROL",
desc: "Role",
fields: ROL,
},
SegmentSpec {
name: "RQ1",
desc: "Requisition Detail-1",
fields: RQ1,
},
SegmentSpec {
name: "RQD",
desc: "Requisition Detail",
fields: RQD,
},
SegmentSpec {
name: "RXA",
desc: "Pharmacy/Treatment Administration",
fields: RXA,
},
SegmentSpec {
name: "RXC",
desc: "Pharmacy/Treatment Component Order",
fields: RXC,
},
SegmentSpec {
name: "RXD",
desc: "Pharmacy/Treatment Dispense",
fields: RXD,
},
SegmentSpec {
name: "RXE",
desc: "Pharmacy/Treatment Encoded Order",
fields: RXE,
},
SegmentSpec {
name: "RXG",
desc: "Pharmacy/Treatment Give",
fields: RXG,
},
SegmentSpec {
name: "RXO",
desc: "Pharmacy/Treatment Order",
fields: RXO,
},
SegmentSpec {
name: "RXR",
desc: "Pharmacy/Treatment Route",
fields: RXR,
},
SegmentSpec {
name: "SCH",
desc: "Scheduling Activity Information",
fields: SCH,
},
SegmentSpec {
name: "SFT",
desc: "Software Segment",
fields: SFT,
},
SegmentSpec {
name: "SPM",
desc: "Specimen",
fields: SPM,
},
SegmentSpec {
name: "STF",
desc: "Staff Identification",
fields: STF,
},
SegmentSpec {
name: "TQ1",
desc: "Timing/Quantity",
fields: TQ1,
},
SegmentSpec {
name: "TQ2",
desc: "Timing/Quantity Relationship",
fields: TQ2,
},
SegmentSpec {
name: "TXA",
desc: "Transcription Document Header",
fields: TXA,
},
SegmentSpec {
name: "UB1",
desc: "UB82",
fields: UB1,
},
SegmentSpec {
name: "UB2",
desc: "UB92 Data",
fields: UB2,
},
SegmentSpec {
name: "URD",
desc: "Results/Update Definition",
fields: URD,
},
SegmentSpec {
name: "URS",
desc: "Unsolicited Selection",
fields: URS,
},
SegmentSpec {
name: "VAR",
desc: "Variance",
fields: VAR,
},
SegmentSpec {
name: "ZL7",
desc: "(proposed example only)",
fields: ZL7,
},
];
const KNOWN_SEGMENT_NAMES: &[(&str, &str)] = &[
("SFT", "Software Segment"),
("UAC", "User Authentication Credential"),
("ACC", "Accident"),
("UB1", "UB82 Data"),
("UB2", "UB92 Data"),
("DB1", "Disability"),
("DRG", "Diagnosis Related Group"),
("ROL", "Role"),
("PDA", "Patient Death and Autopsy"),
("ARV", "Access Restrictions"),
("MRG", "Merge Patient Information"),
("SPM", "Specimen"),
("TQ1", "Timing/Quantity"),
("TQ2", "Timing/Quantity Relationship"),
("RXE", "Pharmacy/Treatment Encoded Order"),
("RXR", "Pharmacy/Treatment Route"),
("RXC", "Pharmacy/Treatment Component Order"),
("RXD", "Pharmacy/Treatment Dispense"),
("RXG", "Pharmacy/Treatment Give"),
("ORO", "Order Other"),
("BLG", "Billing"),
("CTI", "Clinical Trial Identification"),
("QAK", "Query Acknowledgment"),
("QPD", "Query Parameter Definition"),
("RCP", "Response Control Parameter"),
("DSC", "Continuation Pointer"),
("QRF", "Original Style Query Filter"),
("URD", "Results/Update Definition"),
("URS", "Unsolicited Selection"),
("PRA", "Practitioner Detail"),
("STF", "Staff Identification"),
("MFI", "Master File Identification"),
("MFE", "Master File Entry"),
("LOC", "Location Identification"),
("NPU", "Bed Status Update"),
("PEO", "Product Experience Observation"),
("IN2", "Insurance Additional Information"),
("IN3", "Insurance Additional Info - Cert"),
("APR", "Appointment Preferences"),
("ARQ", "Appointment Request"),
("AIG", "Appointment Information - General Resource"),
("OBS", "Observation"),
("CTD", "Contact Data"),
("ODS", "Dietary Orders, Supplements and Preferences"),
("RQD", "Requisition Detail"),
("RXO", "Pharmacy/Treatment Order"),
];
#[must_use]
pub fn segment_spec(name: &str) -> Option<&'static SegmentSpec> {
let at = SEGMENTS.binary_search_by(|s| s.name.cmp(name)).ok()?;
SEGMENTS.get(at)
}
#[must_use]
pub fn segment_desc(name: &str) -> Option<&'static str> {
segment_spec(name).map(|s| s.desc).or_else(|| {
KNOWN_SEGMENT_NAMES
.iter()
.find(|(n, _)| *n == name)
.map(|(_, d)| *d)
})
}
#[must_use]
pub fn field_spec(segment: &str, seq: usize) -> Option<&'static FieldSpec> {
segment_spec(segment).and_then(|s| s.fields.iter().find(|f| f.seq == seq))
}
#[must_use]
pub fn field_label(segment: &str, seq: usize) -> String {
field_spec(segment, seq).map_or_else(|| format!("Field {seq}"), |f| f.name.to_string())
}
#[derive(Debug)]
pub struct TableDef {
pub id: &'static str,
pub name: &'static str,
pub codes: &'static [(&'static str, &'static str)],
pub closed: bool,
}
const TABLES: &[TableDef] = &[
TableDef {
id: "0001",
name: "Administrative Sex",
closed: false,
codes: &[
("F", "Female"),
("M", "Male"),
("O", "Other"),
("U", "Unknown"),
("A", "Ambiguous"),
("N", "Not applicable"),
],
},
TableDef {
id: "0002",
name: "Marital Status",
closed: false,
codes: &[
("A", "Separated"),
("D", "Divorced"),
("M", "Married"),
("S", "Single"),
("W", "Widowed"),
("C", "Common law"),
("G", "Living together"),
("P", "Domestic partner"),
("U", "Unknown"),
("N", "Annulled"),
("I", "Interlocutory"),
("B", "Unmarried"),
("T", "Unreported"),
("R", "Registered domestic partner"),
("E", "Legally separated"),
("O", "Other"),
],
},
TableDef {
id: "0003",
name: "Event Type",
closed: false,
codes: &[
("A01", "Admit/visit notification"),
("A02", "Transfer a patient"),
("A03", "Discharge/end visit"),
("A04", "Register a patient"),
("A05", "Pre-admit a patient"),
("A06", "Change outpatient to inpatient"),
("A07", "Change inpatient to outpatient"),
("A08", "Update patient information"),
("A09", "Patient departing - tracking"),
("A10", "Patient arriving - tracking"),
("A11", "Cancel admit/visit notification"),
("A12", "Cancel transfer"),
("A13", "Cancel discharge/end visit"),
("A14", "Pending admit"),
("A15", "Pending transfer"),
("A16", "Pending discharge"),
("A17", "Swap patients"),
("A18", "Merge patient information"),
("A19", "Patient query"),
("A20", "Bed status update"),
("A21", "Patient goes on leave of absence"),
("A22", "Patient returns from leave"),
("A23", "Delete a patient record"),
("A24", "Link patient information"),
("A25", "Cancel pending discharge"),
("A26", "Cancel pending transfer"),
("A27", "Cancel pending admit"),
("A28", "Add person information"),
("A29", "Delete person information"),
("A30", "Merge person information"),
("A31", "Update person information"),
("A32", "Cancel patient arriving"),
("A33", "Cancel patient departing"),
("A34", "Merge patient - patient ID"),
("A35", "Merge patient - account number"),
("A36", "Merge patient - ID and account"),
("A37", "Unlink patient information"),
("A38", "Cancel pre-admit"),
("A39", "Merge person - external ID"),
("A40", "Merge patient - identifier list"),
("A41", "Merge account - patient account number"),
("A44", "Move account information"),
("A45", "Move visit information"),
("A47", "Change patient identifier list"),
("A60", "Update allergy information"),
("A61", "Change consulting doctor"),
],
},
TableDef {
id: "0004",
name: "Patient Class",
closed: false,
codes: &[
("E", "Emergency"),
("I", "Inpatient"),
("O", "Outpatient"),
("P", "Preadmit"),
("R", "Recurring patient"),
("B", "Obstetrics"),
("C", "Commercial account"),
("N", "Not applicable"),
("U", "Unknown"),
],
},
TableDef {
id: "0006",
name: "Religion",
closed: false,
codes: &[
("A", "Atheist"),
("B", "Baptist"),
("C", "Catholic"),
("E", "Episcopalian"),
("J", "Judaism"),
("L", "Lutheran"),
("M", "Church of Latter Day Saints (Mormon)"),
("N", "Hindu"),
("P", "Protestant"),
("AGN", "Agnostic"),
("ATH", "Atheist"),
("BAH", "Baha'i"),
("BRE", "Brethren"),
("BUD", "Buddhist"),
("BMA", "Buddhist: Mahayana"),
("BTH", "Buddhist: Theravada"),
("BTA", "Buddhist: Tantrayana"),
("BOT", "Buddhist: Other"),
("CFR", "Chinese Folk Religionist"),
("CHR", "Christian"),
("ABC", "Christian: American Baptist Church"),
("AMT", "Christian: African Methodist Episcopal"),
("AME", "Christian: African Methodist Episcopal Zion"),
("ANG", "Christian: Anglican"),
("AOG", "Christian: Assembly of God"),
("BAP", "Christian: Baptist"),
("CRR", "Christian: Christian Reformed"),
("CHS", "Christian: Christian Science"),
("CMA", "Christian: Christian Missionary Alliance"),
("COC", "Christian: Church of Christ"),
("COG", "Christian: Church of God"),
("COI", "Christian: Church of God in Christ"),
("COM", "Christian: Community"),
("COL", "Christian: Congregational"),
("EOT", "Christian: Eastern Orthodox"),
("EVC", "Christian: Evangelical Church"),
("EPI", "Christian: Episcopalian"),
("FWB", "Christian: Free Will Baptist"),
("FRQ", "Christian: Friends"),
("FUL", "Christian: Full Gospel"),
("GRE", "Christian: Greek Orthodox"),
("JWN", "Christian: Jehovah's Witness"),
("MOM", "Christian: Latter-day Saints"),
("LUT", "Christian: Lutheran"),
("LMS", "Christian: Lutheran Missouri Synod"),
("MEN", "Christian: Mennonite"),
("MET", "Christian: Methodist"),
("NAZ", "Christian: Church of the Nazarene"),
("ORT", "Christian: Orthodox"),
("PEN", "Christian: Pentecostal"),
("COP", "Christian: Other Pentecostal"),
("PRE", "Christian: Presbyterian"),
("PRO", "Christian: Protestant"),
("PRC", "Christian: Other Protestant"),
("QUA", "Christian: Friends"),
("REC", "Christian: Reformed Church"),
("REO", "Christian: Reorganized Church of Jesus Christ-LDS"),
("CAT", "Christian: Roman Catholic"),
("SAA", "Christian: Salvation Army"),
("SEV", "Christian: Seventh Day Adventist"),
("SOU", "Christian: Southern Baptist"),
("UCC", "Christian: United Church of Christ"),
("UMD", "Christian: United Methodist"),
("UNI", "Christian: Unitarian"),
("UNU", "Christian: Unitarian Universalist"),
("WES", "Christian: Wesleyan"),
("WMC", "Christian: Wesleyan Methodist"),
("COT", "Christian: Other"),
("CNF", "Confucian"),
("DOC", "Disciples of Christ"),
("ERL", "Ethnic Religionist"),
("HIN", "Hindu"),
("HSH", "Hindu: Shaivites"),
("HVA", "Hindu: Vaishnavites"),
("HOT", "Hindu: Other"),
("JAI", "Jain"),
("JEW", "Jewish"),
("JCO", "Jewish: Conservative"),
("JOR", "Jewish: Orthodox"),
("JRC", "Jewish: Reconstructionist"),
("JRF", "Jewish: Reform"),
("JRN", "Jewish: Renewal"),
("JOT", "Jewish: Other"),
("MOS", "Muslim"),
("MSH", "Muslim: Shiite"),
("MSU", "Muslim: Sunni"),
("MOT", "Muslim: Other"),
("NAM", "Native American"),
("NRL", "New Religionist"),
("NOE", "Nonreligious"),
("SHN", "Shintoist"),
("SIK", "Sikh"),
("SPI", "Spiritist"),
("OTH", "Other"),
("VAR", "Unknown"),
],
},
TableDef {
id: "0007",
name: "Admission Type",
closed: false,
codes: &[
("A", "Accident"),
("C", "Elective"),
("E", "Emergency"),
("L", "Labor and delivery"),
("N", "Newborn"),
("R", "Routine"),
("U", "Urgent"),
],
},
TableDef {
id: "0008",
name: "Acknowledgment Code",
closed: true,
codes: &[
("AA", "Original mode: application accept"),
("AE", "Original mode: application error"),
("AR", "Original mode: application reject"),
("CA", "Enhanced mode: commit accept"),
("CE", "Enhanced mode: commit error"),
("CR", "Enhanced mode: commit reject"),
],
},
TableDef {
id: "0009",
name: "Ambulatory Status",
closed: false,
codes: &[
("A0", "No functional limitations"),
("A1", "Ambulates with assistive device"),
("A2", "Wheelchair/stretcher bound"),
("A3", "Comatose; non-responsive"),
("A4", "Disoriented"),
("A5", "Vision impaired"),
("A6", "Hearing impaired"),
("A7", "Speech impaired"),
("A8", "Non-English speaking"),
("A9", "Functional level unknown"),
("B1", "Oxygen therapy"),
("B2", "Special equipment (tubes, IVs, catheters)"),
("B3", "Amputee"),
("B4", "Mastectomy"),
("B5", "Paraplegic"),
("B6", "Pregnant"),
],
},
TableDef {
id: "0017",
name: "Transaction Type",
closed: false,
codes: &[
("CG", "Charge"),
("CD", "Credit"),
("PY", "Payment"),
("AJ", "Adjustment"),
],
},
TableDef {
id: "0038",
name: "Order Status",
closed: false,
codes: &[
("A", "Some results available"),
("CA", "Order was cancelled"),
("CM", "Order is completed"),
("DC", "Order was discontinued"),
("ER", "Error, order not found"),
("HD", "Order is on hold"),
("IP", "In process, unspecified"),
("RP", "Order has been replaced"),
("SC", "In process, scheduled"),
],
},
TableDef {
id: "0052",
name: "Diagnosis Type",
closed: false,
codes: &[("A", "Admitting"), ("W", "Working"), ("F", "Final")],
},
TableDef {
id: "0062",
name: "Event Reason",
closed: false,
codes: &[
("01", "Patient request"),
("02", "Physician/health practitioner order"),
("03", "Census management"),
("O", "Other"),
("U", "Unknown"),
],
},
TableDef {
id: "0063",
name: "Relationship",
closed: false,
codes: &[
("SEL", "Self"),
("SPO", "Spouse"),
("DOM", "Life partner"),
("CHD", "Child"),
("PAR", "Parent"),
("MTH", "Mother"),
("FTH", "Father"),
("SIB", "Sibling"),
("BRO", "Brother"),
("SIS", "Sister"),
("GRD", "Guardian"),
("EMR", "Emergency contact"),
("FND", "Friend"),
("OTH", "Other"),
("UNK", "Unknown"),
("EME", "Employee"),
("EMC", "Emergency contact"),
("GRP", "Grandparent"),
("EXF", "Extended family"),
],
},
TableDef {
id: "0065",
name: "Specimen Action Code",
closed: false,
codes: &[
("A", "Add ordered tests"),
("G", "Generated order"),
("L", "Lab to obtain specimen"),
("O", "Specimen obtained by service other than lab"),
("P", "Pending specimen"),
("R", "Revised order"),
("S", "Schedule the tests"),
],
},
TableDef {
id: "0074",
name: "Diagnostic Service Section ID",
closed: false,
codes: &[
("AU", "Audiology"),
("BG", "Blood gases"),
("BLB", "Blood bank"),
("CH", "Chemistry"),
("CP", "Cytopathology"),
("CT", "CAT scan"),
("CTH", "Cardiac catheterization"),
("CUS", "Cardiac ultrasound"),
("EC", "Electrocardiac"),
("EN", "Electroneuro"),
("HM", "Hematology"),
("ICU", "Bedside ICU monitoring"),
("IMM", "Immunology"),
("LAB", "Laboratory"),
("MB", "Microbiology"),
("MCB", "Mycobacteriology"),
("MYC", "Mycology"),
("NMR", "Nuclear magnetic resonance"),
("NMS", "Nuclear medicine scan"),
("NRS", "Nursing service measures"),
("OSL", "Outside lab"),
("OT", "Occupational therapy"),
("OTH", "Other"),
("OUS", "OB ultrasound"),
("PF", "Pulmonary function"),
("PHR", "Pharmacy"),
("PHY", "Physician (Hx, Dx, admission note)"),
("PT", "Physical therapy"),
("RAD", "Radiology"),
("RC", "Respiratory care"),
("RT", "Radiation therapy"),
("RUS", "Radiology ultrasound"),
("RX", "Radiograph"),
("SP", "Surgical pathology"),
("SR", "Serology"),
("TX", "Toxicology"),
("VR", "Virology"),
("VUS", "Vascular ultrasound"),
("XRC", "Cineradiograph"),
],
},
TableDef {
id: "0076",
name: "Message Type",
closed: false,
codes: &[
("ACK", "General acknowledgment"),
("ADT", "Admit/discharge/transfer"),
("BAR", "Add/change billing account"),
("DFT", "Detail financial transaction"),
("MDM", "Medical document management"),
("MFN", "Master files notification"),
("MFK", "Master files application acknowledgment"),
("OMG", "General clinical order"),
("OML", "Laboratory order"),
("OMP", "Pharmacy/treatment order"),
("ORM", "Order message"),
("ORR", "Order response"),
("ORU", "Observation result unsolicited"),
("OUL", "Unsolicited laboratory observation"),
("QBP", "Query by parameter"),
("QRY", "Query, original mode"),
("RAS", "Pharmacy/treatment administration"),
("RDE", "Pharmacy/treatment encoded order"),
("RDS", "Pharmacy/treatment dispense"),
("RGV", "Pharmacy/treatment give"),
("RSP", "Segment pattern response"),
("SIU", "Schedule information unsolicited"),
("SRM", "Schedule request"),
("SRR", "Scheduled request response"),
("SQM", "Schedule query"),
("VXU", "Unsolicited vaccination record update"),
("VXQ", "Query for vaccination record"),
],
},
TableDef {
id: "0078",
name: "Abnormal Flags",
closed: false,
codes: &[
("L", "Below low normal"),
("H", "Above high normal"),
("LL", "Below lower panic limit"),
("HH", "Above upper panic limit"),
("N", "Normal"),
("A", "Abnormal"),
("AA", "Critically abnormal"),
("<", "Below absolute low-off instrument scale"),
(">", "Above absolute high-off instrument scale"),
("S", "Susceptible"),
("R", "Resistant"),
("I", "Intermediate"),
("MS", "Moderately susceptible"),
("VS", "Very susceptible"),
("U", "Significant change up"),
("D", "Significant change down"),
("B", "Better"),
("W", "Worse"),
("null", "No level defined"),
],
},
TableDef {
id: "0080",
name: "Nature of Abnormal Testing",
closed: false,
codes: &[
("A", "An age-based population"),
("N", "None - generic normal range"),
("R", "A race-based population"),
("S", "A sex-based population"),
("SP", "Species"),
("B", "Breed"),
("ST", "Strain"),
],
},
TableDef {
id: "0085",
name: "Observation Result Status",
closed: false,
codes: &[
("C", "Corrected result"),
("D", "Deleted"),
("F", "Final result"),
("I", "Specimen in lab, results pending"),
("P", "Preliminary result"),
("R", "Results entered, not verified"),
("S", "Partial results"),
("U", "Results status change to final"),
("W", "Post original as wrong"),
("X", "Results cannot be obtained"),
],
},
TableDef {
id: "0091",
name: "Query Priority",
closed: false,
codes: &[("D", "Deferred"), ("I", "Immediate")],
},
TableDef {
id: "0092",
name: "Re - Admission Indicator",
closed: false,
codes: &[
("R", "Re-admission"),
],
},
TableDef {
id: "0103",
name: "Processing ID",
closed: true,
codes: &[("D", "Debugging"), ("P", "Production"), ("T", "Training")],
},
TableDef {
id: "0104",
name: "Version ID",
closed: true,
codes: &[
("2.0", "Release 2.0 (1988)"),
("2.0D", "Demo 2.0"),
("2.1", "Release 2.1 (1990)"),
("2.2", "Release 2.2 (1994)"),
("2.3", "Release 2.3 (1997)"),
("2.3.1", "Release 2.3.1 (1999)"),
("2.4", "Release 2.4 (2000)"),
("2.5", "Release 2.5 (2003)"),
("2.5.1", "Release 2.5.1 (2007)"),
("2.6", "Release 2.6 (2007)"),
("2.7", "Release 2.7 (2011)"),
("2.7.1", "Release 2.7.1 (2012)"),
("2.8", "Release 2.8 (2014)"),
("2.8.1", "Release 2.8.1 (2015)"),
("2.8.2", "Release 2.8.2 (2016)"),
("2.9", "Release 2.9 (2019)"),
],
},
TableDef {
id: "0105",
name: "Source of Comment",
closed: false,
codes: &[
("L", "Ancillary (filler) department"),
("P", "Orderer (placer)"),
("O", "Other system"),
],
},
TableDef {
id: "0106",
name: "Query/Response Format Code",
closed: false,
codes: &[
("D", "Response is in display format"),
("R", "Response is in record-oriented format"),
("T", "Response is in tabular format"),
],
},
TableDef {
id: "0112",
name: "Discharge Disposition",
closed: false,
codes: &[
("01", "Discharged to home or self care"),
("02", "Discharged to another short term hospital"),
("03", "Discharged to skilled nursing facility"),
("04", "Discharged to intermediate care facility"),
("05", "Discharged to another institution"),
("06", "Discharged to home under care of home health service"),
("07", "Left against medical advice"),
("20", "Expired"),
("30", "Still patient"),
],
},
TableDef {
id: "0119",
name: "Order Control Codes",
closed: false,
codes: &[
("NW", "New order"),
("OK", "Order accepted"),
("CA", "Cancel order request"),
("CR", "Cancelled as requested"),
("DC", "Discontinue order request"),
("DR", "Discontinued as requested"),
("HD", "Hold order request"),
("RO", "Replacement order"),
("RP", "Order replace request"),
("RU", "Replaced unsolicited"),
("SC", "Status changed"),
("SN", "Send order number"),
("UA", "Unable to accept order"),
("UC", "Unable to cancel"),
("XO", "Change order request"),
("XX", "Order changed, unsolicited"),
("RE", "Observations to follow"),
],
},
TableDef {
id: "0123",
name: "Result Status",
closed: false,
codes: &[
("O", "Order received, specimen not yet received"),
("I", "No results available, specimen received"),
("S", "No results available, procedure scheduled"),
("A", "Some results available"),
("P", "Preliminary"),
("C", "Correction to results"),
("R", "Results entered, not verified"),
("F", "Final results"),
("X", "No results available, order cancelled"),
("Y", "No order on record"),
("Z", "No record of this patient"),
],
},
TableDef {
id: "0125",
name: "Value Type",
closed: false,
codes: &[
("AD", "Address"),
("CE", "Coded entry"),
("CF", "Coded element with formatted values"),
("CK", "Composite ID with check digit"),
("CN", "Composite ID and name"),
("CP", "Composite price"),
("CWE", "Coded with exceptions"),
("CX", "Extended composite ID"),
("DT", "Date"),
("ED", "Encapsulated data"),
("FT", "Formatted text"),
("ID", "Coded value"),
("IS", "Coded value, user table"),
("MO", "Money"),
("NM", "Numeric"),
("PN", "Person name"),
("RP", "Reference pointer"),
("SN", "Structured numeric"),
("ST", "String"),
("TM", "Time"),
("TN", "Telephone number"),
("TS", "Time stamp"),
("TX", "Text"),
("XAD", "Extended address"),
("XCN", "Extended composite name and ID"),
("XON", "Extended organization name"),
("XPN", "Extended person name"),
("XTN", "Extended telecommunication number"),
],
},
TableDef {
id: "0127",
name: "Allergen Type",
closed: false,
codes: &[
("DA", "Drug allergy"),
("FA", "Food allergy"),
("MA", "Miscellaneous allergy"),
("MC", "Miscellaneous contraindication"),
("EA", "Environmental allergy"),
("AA", "Animal allergy"),
("PA", "Plant allergy"),
("LA", "Pollen allergy"),
],
},
TableDef {
id: "0128",
name: "Allergy Severity",
closed: false,
codes: &[
("SV", "Severe"),
("MO", "Moderate"),
("MI", "Mild"),
("U", "Unknown"),
],
},
TableDef {
id: "0136",
name: "Yes/No Indicator",
closed: true,
codes: &[("Y", "Yes"), ("N", "No")],
},
TableDef {
id: "0155",
name: "Accept/Application Acknowledgment Conditions",
closed: true,
codes: &[
("AL", "Always"),
("NE", "Never"),
("ER", "Only on error"),
("SU", "Only on success"),
],
},
TableDef {
id: "0189",
name: "Ethnic Group",
closed: false,
codes: &[
("H", "Hispanic or Latino"),
("N", "Not Hispanic or Latino"),
("U", "Unknown"),
],
},
TableDef {
id: "0203",
name: "Identifier Type",
closed: false,
codes: &[
("AC", "Accreditation/Certification Identifier"),
("ACSN", "Accession ID"),
("AIN", "Animal Identification Number (US Official)"),
("AM", "American Express"),
("AMA", "American Medical Association Number"),
("AN", "Account number"),
("ANC", "Account number Creditor"),
("AND", "Account number debitor"),
("ANON", "Anonymous identifier"),
("ANT", "Temporary Account Number"),
("APRN", "Advanced Practice Registered Nurse number"),
("ASID", "Ancestor Specimen ID"),
("BA", "Bank Account Number"),
("BC", "Bank Card Number"),
("BCFN", "Birth Certificate File Number"),
("BCT", "Birth Certificate"),
("BR", "Birth registry number"),
("BRN", "Breed Registry Number"),
("BSNR", "Primary physician office number"),
("CAAI", "Consumer Application Account Identifier"),
("CC", "Cost Center number"),
("CONM", "Change of Name Document"),
("CY", "County number"),
("CZ", "Citizenship Card"),
("DC", "Death Certificate ID"),
("DCFN", "Death Certificate File Number"),
("DDS", "Dentist license number"),
("DEA", "Drug Enforcement Administration registration number"),
("DFN", "Drug Furnishing or prescriptive authority Number"),
("DI", "Diner's Club card"),
("DL", "Driver's license number"),
("DN", "Doctor number"),
("DO", "Osteopathic License number"),
("DP", "Diplomatic Passport"),
("DPM", "Podiatrist license number"),
("DR", "Donor Registration Number"),
("DS", "Discover Card"),
("DSG", "Diagnostic Study Group"),
("EI", "Employee number"),
("EN", "Employer number"),
("ESN", "Staff Enterprise Number"),
("FDR", "Fetal Death Report ID"),
("FDRFN", "Fetal Death Report File Number"),
("FGN", "Filler Group Number"),
("FI", "Facility ID"),
("FILL", "Filler Identifier"),
("GI", "Guarantor internal identifier"),
("GIN", "Animal Group Identifier (US Official)"),
("GL", "General ledger number"),
("GN", "Guarantor external identifier"),
("HC", "Health Card Number"),
("IND", "Indigenous/Aboriginal"),
("IRISTEM", "An IRI stem"),
("JHN", "Jurisdictional health number"),
("LACSN", "Laboratory Accession ID"),
("LANR", "Lifelong physician number"),
("LI", "Labor and industries number"),
("L&I", "Labor and industries number"),
("LN", "License number"),
("LR", "Local Registry ID"),
("MA", "Patient Medicaid number"),
("MB", "Member Number"),
("MC", "Patient's Medicare number"),
("MCD", "Practitioner Medicaid number"),
("MCN", "Microchip Number"),
("MCR", "Practitioner Medicare number"),
("MCT", "Marriage Certificate"),
("MD", "Medical License number"),
("MI", "Military ID number"),
("MR", "Medical record number"),
("MRT", "Temporary Medical Record Number"),
("MS", "MasterCard"),
("NBSNR", "Secondary physician office number"),
("NCT", "Naturalization Certificate"),
("NE", "National employer identifier"),
("NH", "National Health Plan Identifier"),
("NI", "National unique individual identifier"),
("NII", "National Insurance Organization Identifier"),
("NIIP", "National Insurance Payor Identifier (Payor)"),
("NNxxx", "National Person Identifier where the xxx is the ISO table 3166 3-character (alphabetic) country code"),
("NP", "Nurse practitioner number"),
("NPI", "National provider identifier"),
("OBI", "Observation Instance Identifier"),
("OD", "Optometrist license number"),
("PA", "Physician Assistant number"),
("PC", "Parole Card"),
("PCN", "Penitentiary/correctional institution Number"),
("PE", "Living Subject Enterprise Number"),
("PEN", "Pension Number"),
("PGN", "Placer Group Number"),
("PHC", "Public Health Case Identifier"),
("PHE", "Public Health Event Identifier"),
("PHO", "Public Health Official ID"),
("PI", "Patient internal identifier"),
("PIN", "Premises Identifier Number (US Official)"),
("PLAC", "Placer Identifier"),
("PN", "Person number"),
("PNT", "Temporary Living Subject Number"),
("PPIN", "Medicare/CMS Performing Provider Identification Number"),
("PPN", "Passport number"),
("PRC", "Permanent Resident Card Number"),
("PRN", "Provider number"),
("PT", "Patient external identifier"),
("QA", "QA number"),
("RI", "Resource identifier"),
("RN", "Registered Nurse Number"),
("RPH", "Pharmacist license number"),
("RR", "Railroad Retirement number"),
("RRI", "Regional registry ID"),
("RRP", "Railroad Retirement Provider"),
("SAMN", "SAMN# accession Number"),
("SB", "Social Beneficiary Identifier"),
("SID", "Specimen ID"),
("SL", "State license"),
("SN", "Subscriber Number"),
("SNBSN", "State assigned NDBS card Identifier"),
("SNO", "Serial Number"),
("SP", "Study Permit"),
("SR", "State registry ID"),
("SRX", "SRA Accession number"),
("SS", "Social Security number"),
("STN", "Shipment Tracking Number"),
("TAX", "Tax ID number"),
("TN", "Treaty Number/ (Canada)"),
("TPR", "Temporary Permanent Resident (Canada)"),
("TRL", "Training License Number"),
("U", "Unspecified identifier"),
("UDI", "Universal Device Identifier"),
("UPIN", "Medicare/CMS (formerly HCFA)'s Universal Physician Identification numbers"),
("USID", "Unique Specimen ID"),
("VN", "Visit number"),
("VP", "Visitor Permit"),
("VS", "VISA"),
("WC", "WIC identifier"),
("WCN", "Workers' Comp Number"),
("WP", "Work Permit"),
("XV", "Health Plan Identifier"),
("XX", "Organization identifier"),
],
},
TableDef {
id: "0206",
name: "Segment Action Code",
closed: true,
codes: &[("A", "Add/insert"), ("D", "Delete"), ("U", "Update")],
},
TableDef {
id: "0211",
name: "Alternate Character Sets",
closed: false,
codes: &[
("JAS2020", "A subset of ISO2020 used for most Kanjii transmissions"),
("JIS X 0202", "ISO 2022 with escape sequences for Kanjii"),
("ASCII", "The printable 7-bit ASCII character set."),
("8859/1", "The printable characters from the ISO 8859/1 Character set"),
("8859/2", "The printable characters from the ISO 8859/2 Character set"),
("8859/3", "The printable characters from the ISO 8859/3 Character set"),
("8859/4", "The printable characters from the ISO 8859/4 Character set"),
("8859/5", "The printable characters from the ISO 8859/5 Character set"),
("8859/6", "The printable characters from the ISO 8859/6 Character set"),
("8859/7", "The printable characters from the ISO 8859/7 Character set"),
("8859/8", "The printable characters from the ISO 8859/8 Character set"),
("8859/9", "The printable characters from the ISO 8859/9 Character set"),
("8859/15", "The printable characters from the ISO 8859/15 (Latin-15)"),
("ISO IR6", "ASCII graphic character set consisting of 94 characters."),
("ISO IR14", "Code for Information Exchange (one byte)(JIS X 0201-1976)."),
("ISO IR87", "Code for the Japanese Graphic Character set for information interchange (JIS X 0208-1990),"),
("ISO IR159", "Code of the supplementary Japanese Graphic Character set for information interchange (JIS X 0212-1990)."),
("GB 18030-2000", "Code for Chinese Character Set (GB 18030-2000)"),
("KS X 1001", "Code for Korean Character Set (KS X 1001)"),
("CNS 11643-1992", "Code for Taiwanese Character Set (CNS 11643-1992)"),
("BIG-5", "Code for Taiwanese Character Set (BIG-5)"),
("UNICODE", "The world wide character standard from ISO/IEC 10646-1-1993"),
("UNICODE UTF-8", "UCS Transformation Format, 8-bit form"),
("UNICODE UTF-16", "UCS Transformation Format, 16-bit form"),
("UNICODE UTF-32", "UCS Transformation Format, 32-bit form"),
],
},
TableDef {
id: "0215",
name: "Publicity",
closed: false,
codes: &[
("F", "Family only"),
("N", "No Publicity"),
("O", "Other"),
("U", "Unknown"),
],
},
TableDef {
id: "0216",
name: "Patient Status",
closed: false,
codes: &[
("AI", "Active Inpatient"),
("DI", "Discharged Inpatient"),
],
},
TableDef {
id: "0220",
name: "Living Arrangement",
closed: false,
codes: &[
("A", "Alone"),
("F", "Family"),
("I", "Institution"),
("R", "Relative"),
("U", "Unknown"),
("S", "Spouse Only"),
],
},
TableDef {
id: "0223",
name: "Living Dependency",
closed: false,
codes: &[
("D", "Spouse dependent"),
("S", "Spouse Dependent"),
("M", "Medical Supervision Required"),
("C", "Small Children Dependent"),
("WU", "Walk up"),
("O", "Other"),
("CB", "Common Bath"),
("U", "Unknown"),
],
},
TableDef {
id: "0230",
name: "Procedure Functional Type",
closed: false,
codes: &[
("A", "Anesthesia"),
("D", "Diagnostic procedure"),
("I", "Invasive procedure not classified"),
("P", "Procedure for treatment"),
],
},
TableDef {
id: "0270",
name: "Document Type",
closed: false,
codes: &[
("AR", "Autopsy report"),
("CD", "Cardiodiagnostics"),
("CN", "Consultation"),
("DS", "Discharge summary"),
("ED", "Emergency department report"),
("HP", "History and physical examination"),
("OP", "Operative report"),
("PC", "Psychiatric consultation"),
("PH", "Psychiatric history and physical"),
("PN", "Procedure note"),
("PR", "Progress note"),
("SP", "Surgical pathology"),
("TS", "Transfer summary"),
],
},
TableDef {
id: "0271",
name: "Document Completion Status",
closed: false,
codes: &[
("AU", "Authenticated"),
("DI", "Dictated"),
("DO", "Documented"),
("IN", "Incomplete"),
("IP", "In progress"),
("LA", "Legally authenticated"),
("PA", "Pre-authenticated"),
],
},
TableDef {
id: "0272",
name: "Document Confidentiality Status",
closed: false,
codes: &[
("1", "ASTM Level 1"),
("2", "ASTM Level 2"),
("3", "ASTM Level 3"),
("RE", "Restricted"),
("UC", "Usual control"),
("VR", "Very restricted"),
("V", "Very restricted"),
("R", "Restricted"),
("U", "Usual control"),
],
},
TableDef {
id: "0276",
name: "Appointment Reason",
closed: false,
codes: &[
("ROUTINE", "Routine appointment - default if not valued"),
("WALKIN", "A previously unscheduled walk-in visit"),
("CHECKUP", "A routine check-up, such as an annual physical"),
("FOLLOWUP", "A follow up visit from a previous appointment"),
("EMERGENCY", "Emergency appointment"),
],
},
TableDef {
id: "0277",
name: "Appointment Type",
closed: false,
codes: &[
("COMPLETE", "A request to add a completed appointment, used to maintain records of completed appointments that did not appear in the schedule (e.g., STAT, walk-in, etc.)"),
("NORMAL", "Routine schedule request type - default if not valued"),
("TENTATIVE", "A request for a tentative (e.g., “penciled in”) appointment"),
("Normal", "Routine schedule request type – default if not valued"),
("Tentative", "A request for a tentative (e.g., “penciled in”) appointment"),
("Complete", "A request to add a completed appointment, used to maintain records of completed appointments that did not appear in the schedule (e.g., STAT, walk-in, etc.)"),
],
},
TableDef {
id: "0278",
name: "Filler Status",
closed: false,
codes: &[
("BLOCKED", "Blocked"),
("BOOKED", "Booked"),
("CANCELLED", "Cancelled"),
("COMPLETE", "Complete"),
("DELETED", "Deleted"),
("OVERBOOK", "Overbook"),
("PENDING", "Pending"),
("STARTED", "Started"),
("WAITLIST", "Waitlist"),
("Pending", "Pending"),
("Waitlist", "Waitlist"),
("Booked", "Booked"),
("Started", "Started"),
("Complete", "Complete"),
("Cancelled", "Cancelled"),
("DC", "Discontinued"),
("Discontinued", "Discontinued"),
("Deleted", "Deleted"),
("Blocked", "Blocked"),
("Overbook", "Overbook"),
("Noshow", "Noshow"),
],
},
TableDef {
id: "0305",
name: "Person Location Type",
closed: false,
codes: &[
("C", "Clinic"),
("D", "Department"),
("H", "Home"),
("N", "Nursing Unit"),
("O", "Provider's Office"),
("P", "Phone"),
("S", "SNF"),
],
},
TableDef {
id: "0322",
name: "Completion Status",
closed: false,
codes: &[
("CP", "Complete"),
("RE", "Refused"),
("NA", "Not administered"),
("PA", "Partially administered"),
],
},
TableDef {
id: "0323",
name: "Action Code",
closed: false,
codes: &[("A", "Add"), ("D", "Delete"), ("U", "Update")],
},
TableDef {
id: "0326",
name: "Visit Indicator",
closed: false,
codes: &[("A", "Account level"), ("V", "Visit level")],
},
TableDef {
id: "0356",
name: "Alternate Character Set Handling Scheme",
closed: false,
codes: &[
("ISO 2022-1994", "This standard is titled 'Information Technology - Character Code Structure and Extension Technique'. ."),
("2.3", "The character set switching mode specified in HL7 2.5, section 2.7.2 and section 2.A.46, 'XPN - extended person name'."),
("<null>", "This is the default, indicating that there is no character set switching occurring in this message."),
],
},
TableDef {
id: "0357",
name: "Message Error Condition Codes",
closed: false,
codes: &[
("0", "Message accepted"),
("100", "Segment sequence error"),
("101", "Required field missing"),
("102", "Data type error"),
("103", "Table value not found"),
("200", "Unsupported message type"),
("201", "Unsupported event code"),
("202", "Unsupported processing id"),
("203", "Unsupported version id"),
("204", "Unknown key identifier"),
("205", "Duplicate key identifier"),
("206", "Application record locked"),
("207", "Application internal error"),
],
},
TableDef {
id: "0359",
name: "Diagnosis Priority",
closed: false,
codes: &[
("0", "Not included in diagnosis ranking"),
("1", "The primary diagnosis"),
("2 and higher", "for ranked secondary diagnoses"),
("2 ...", "For ranked secondary diagnoses"),
("2", "For secondary diagnosis"),
("...", "No suggested values defined"),
("3", "For tertiary diagnosis"),
("4", "For quaternary diagnosis"),
],
},
TableDef {
id: "0364",
name: "Comment Type",
closed: false,
codes: &[
("PI", "Patient Instructions"),
("AI", "Ancillary Instructions"),
("GI", "General Instructions"),
("1R", "Primary Reason"),
("2R", "Secondary Reason"),
("GR", "General Reason"),
("RE", "Remark"),
("DR", "Duplicate/Interaction Reason"),
],
},
TableDef {
id: "0429",
name: "Production Class",
closed: false,
codes: &[
("BR", "Breeding/genetic stock"),
("DA", "Dairy"),
("DR", "Draft"),
("DU", "Dual Purpose"),
("LY", "Layer, Includes Multiplier flocks"),
("MT", "Meat"),
("OT", "Other"),
("PL", "Pleasure"),
("RA", "Racing"),
("SH", "Show"),
("NA", "Not Applicable"),
("U", "Unknown"),
],
},
TableDef {
id: "0445",
name: "Identity Reliability",
closed: false,
codes: &[
("US", "Unknown/Default Social Security Number"),
("UD", "Unknown/Default Date of Birth"),
("UA", "Unknown/Default Address"),
("AL", "Patient/Person Name is an Alias"),
],
},
TableDef {
id: "0516",
name: "Error Severity",
closed: true,
codes: &[("E", "Error"), ("W", "Warning"), ("I", "Information")],
},
];
const UNVALIDATED_TABLES: &[(&str, &str)] = &[
("0069", "Hospital Service is defined per site"),
("0131", "Contact Role is defined per site"),
(
"0005",
"Race now uses the CDC value set, not the retired HL7 fragment",
),
];
#[must_use]
pub fn is_unvalidated_table(id: &str) -> bool {
UNVALIDATED_TABLES.iter().any(|(t, _)| *t == id)
}
#[must_use]
pub fn table(id: &str) -> Option<&'static TableDef> {
let at = TABLES.binary_search_by(|t| t.id.cmp(id)).ok()?;
TABLES.get(at)
}
impl TableDef {
#[must_use]
pub fn meaning(&self, code: &str) -> Option<&'static str> {
self.codes.iter().find(|(c, _)| *c == code).map(|(_, m)| *m)
}
}
#[must_use]
pub fn code_meaning(table_id: &str, code: &str) -> Option<&'static str> {
table(table_id).and_then(|t| t.meaning(code))
}
#[derive(Debug, Clone, Copy)]
pub struct StructSeg {
pub name: &'static str,
pub required: bool,
}
const fn req(name: &'static str) -> StructSeg {
StructSeg {
name,
required: true,
}
}
const fn opt(name: &'static str) -> StructSeg {
StructSeg {
name,
required: false,
}
}
#[derive(Debug, Clone, Copy)]
pub struct MessageSpec {
pub id: &'static str,
pub desc: &'static str,
pub segments: &'static [StructSeg],
}
const ADT_VISIT: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
opt("PD1"),
opt("ARV"),
opt("ROL"),
opt("NK1"),
req("PV1"),
opt("PV2"),
opt("ROL"),
opt("DB1"),
opt("OBX"),
opt("AL1"),
opt("DG1"),
opt("DRG"),
opt("PR1"),
opt("GT1"),
opt("IN1"),
opt("IN2"),
opt("IN3"),
opt("ACC"),
opt("UB1"),
opt("UB2"),
opt("PDA"),
];
const ADT_PERSON: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
opt("PD1"),
opt("ARV"),
opt("ROL"),
opt("NK1"),
opt("PV1"),
opt("PV2"),
opt("DB1"),
opt("OBX"),
opt("AL1"),
opt("DG1"),
opt("DRG"),
opt("PR1"),
opt("GT1"),
opt("IN1"),
opt("IN2"),
opt("IN3"),
opt("ACC"),
opt("UB1"),
opt("UB2"),
];
const ADT_MERGE: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
opt("PD1"),
req("MRG"),
opt("PV1"),
];
const ORU_R01: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
opt("PID"),
opt("PD1"),
opt("NTE"),
opt("NK1"),
opt("PV1"),
opt("PV2"),
opt("ORC"),
req("OBR"),
opt("NTE"),
opt("TQ1"),
opt("CTD"),
opt("OBX"),
opt("NTE"),
opt("SPM"),
opt("DSC"),
];
const ORM_O01: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
opt("PID"),
opt("PD1"),
opt("NTE"),
opt("PV1"),
opt("PV2"),
opt("IN1"),
opt("IN2"),
opt("IN3"),
opt("GT1"),
opt("AL1"),
req("ORC"),
opt("OBR"),
opt("RXO"),
opt("RQD"),
opt("ODS"),
opt("NTE"),
opt("DG1"),
opt("OBX"),
opt("NTE"),
opt("CTI"),
opt("BLG"),
];
const OML_O21: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
opt("NTE"),
opt("PID"),
opt("PD1"),
opt("NTE"),
opt("PV1"),
opt("PV2"),
opt("IN1"),
opt("GT1"),
opt("AL1"),
req("ORC"),
opt("TQ1"),
opt("TQ2"),
req("OBR"),
opt("NTE"),
opt("DG1"),
opt("OBX"),
opt("NTE"),
opt("SPM"),
];
const ACK_MSG: &[StructSeg] = &[req("MSH"), opt("SFT"), req("MSA"), opt("ERR")];
const SIU_MSG: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("SCH"),
opt("TQ1"),
opt("NTE"),
opt("PID"),
opt("PD1"),
opt("PV1"),
opt("PV2"),
opt("OBX"),
opt("DG1"),
opt("RGS"),
opt("AIS"),
opt("AIG"),
opt("AIL"),
opt("AIP"),
opt("NTE"),
];
const MDM_T02: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
req("PV1"),
opt("ORC"),
opt("OBR"),
opt("NTE"),
req("TXA"),
opt("OBX"),
opt("NTE"),
];
const MDM_T01: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
req("PV1"),
req("TXA"),
];
const VXU_V04: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("PID"),
opt("PD1"),
opt("NK1"),
opt("PV1"),
opt("PV2"),
opt("GT1"),
opt("IN1"),
opt("IN2"),
opt("IN3"),
opt("ORC"),
opt("TQ1"),
req("RXA"),
opt("RXR"),
opt("OBX"),
opt("NTE"),
];
const DFT_P03: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
opt("PD1"),
opt("ROL"),
opt("PV1"),
opt("PV2"),
opt("ROL"),
opt("DB1"),
opt("OBX"),
opt("DG1"),
opt("DRG"),
opt("GT1"),
opt("IN1"),
opt("IN2"),
opt("IN3"),
opt("ACC"),
req("FT1"),
opt("NTE"),
opt("PR1"),
];
const BAR_P01: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
req("EVN"),
req("PID"),
opt("PD1"),
opt("PV1"),
opt("PV2"),
opt("DB1"),
opt("OBX"),
opt("AL1"),
opt("DG1"),
opt("DRG"),
opt("PR1"),
opt("GT1"),
opt("NK1"),
opt("IN1"),
opt("IN2"),
opt("IN3"),
opt("ACC"),
opt("UB1"),
opt("UB2"),
];
const QRY_MSG: &[StructSeg] = &[req("MSH"), req("QRD"), opt("QRF"), opt("DSC")];
const RDE_MSG: &[StructSeg] = &[
req("MSH"),
opt("SFT"),
opt("NTE"),
opt("PID"),
opt("PD1"),
opt("NTE"),
opt("PV1"),
opt("PV2"),
opt("IN1"),
opt("GT1"),
opt("AL1"),
req("ORC"),
opt("TQ1"),
req("RXE"),
opt("NTE"),
opt("RXR"),
opt("RXC"),
opt("OBX"),
opt("CTI"),
];
const MESSAGES: &[MessageSpec] = &[
MessageSpec {
id: "ADT^A01",
desc: "Admit / Visit Notification",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A02",
desc: "Transfer a Patient",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A03",
desc: "Discharge / End Visit",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A04",
desc: "Register a Patient",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A05",
desc: "Pre-admit a Patient",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A06",
desc: "Change Outpatient to Inpatient",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A07",
desc: "Change Inpatient to Outpatient",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A08",
desc: "Update Patient Information",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A09",
desc: "Patient Departing - Tracking",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A10",
desc: "Patient Arriving - Tracking",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A11",
desc: "Cancel Admit / Visit Notification",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A12",
desc: "Cancel Transfer",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A13",
desc: "Cancel Discharge / End Visit",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A14",
desc: "Pending Admit",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A15",
desc: "Pending Transfer",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A16",
desc: "Pending Discharge",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A17",
desc: "Swap Patients",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A18",
desc: "Merge Patient Information",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A20",
desc: "Bed Status Update",
segments: &[req("MSH"), req("EVN"), req("NPU")],
},
MessageSpec {
id: "ADT^A21",
desc: "Patient Goes on Leave of Absence",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A22",
desc: "Patient Returns from Leave of Absence",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A23",
desc: "Delete a Patient Record",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A25",
desc: "Cancel Pending Discharge",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A26",
desc: "Cancel Pending Transfer",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A27",
desc: "Cancel Pending Admit",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A28",
desc: "Add Person Information",
segments: ADT_PERSON,
},
MessageSpec {
id: "ADT^A29",
desc: "Delete Person Information",
segments: ADT_PERSON,
},
MessageSpec {
id: "ADT^A30",
desc: "Merge Person Information",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A31",
desc: "Update Person Information",
segments: ADT_PERSON,
},
MessageSpec {
id: "ADT^A34",
desc: "Merge Patient Information - Patient ID",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A35",
desc: "Merge Patient Information - Account Number",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A38",
desc: "Cancel Pre-admit",
segments: ADT_VISIT,
},
MessageSpec {
id: "ADT^A40",
desc: "Merge Patient - Patient Identifier List",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A44",
desc: "Move Account Information",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A45",
desc: "Move Visit Information",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A47",
desc: "Change Patient Identifier List",
segments: ADT_MERGE,
},
MessageSpec {
id: "ADT^A60",
desc: "Update Allergy Information",
segments: ADT_PERSON,
},
MessageSpec {
id: "ACK",
desc: "General Acknowledgment",
segments: ACK_MSG,
},
MessageSpec {
id: "ORU^R01",
desc: "Unsolicited Observation Result",
segments: ORU_R01,
},
MessageSpec {
id: "ORU^R30",
desc: "Unsolicited Point-of-Care Observation",
segments: ORU_R01,
},
MessageSpec {
id: "OUL^R21",
desc: "Unsolicited Laboratory Observation",
segments: ORU_R01,
},
MessageSpec {
id: "ORM^O01",
desc: "Order Message",
segments: ORM_O01,
},
MessageSpec {
id: "OMG^O19",
desc: "General Clinical Order",
segments: OML_O21,
},
MessageSpec {
id: "OML^O21",
desc: "Laboratory Order",
segments: OML_O21,
},
MessageSpec {
id: "ORR^O02",
desc: "Order Response",
segments: &[
req("MSH"),
req("MSA"),
opt("ERR"),
opt("PID"),
opt("ORC"),
opt("OBR"),
],
},
MessageSpec {
id: "RDE^O11",
desc: "Pharmacy/Treatment Encoded Order",
segments: RDE_MSG,
},
MessageSpec {
id: "SIU^S12",
desc: "Notification of New Appointment",
segments: SIU_MSG,
},
MessageSpec {
id: "SIU^S13",
desc: "Notification of Appointment Rescheduling",
segments: SIU_MSG,
},
MessageSpec {
id: "SIU^S14",
desc: "Notification of Appointment Modification",
segments: SIU_MSG,
},
MessageSpec {
id: "SIU^S15",
desc: "Notification of Appointment Cancellation",
segments: SIU_MSG,
},
MessageSpec {
id: "SIU^S17",
desc: "Notification of Appointment Deletion",
segments: SIU_MSG,
},
MessageSpec {
id: "SIU^S26",
desc: "Notification of Patient Did Not Show",
segments: SIU_MSG,
},
MessageSpec {
id: "MDM^T01",
desc: "Original Document Notification",
segments: MDM_T01,
},
MessageSpec {
id: "MDM^T02",
desc: "Original Document Notification and Content",
segments: MDM_T02,
},
MessageSpec {
id: "MDM^T04",
desc: "Document Status Change Notification and Content",
segments: MDM_T02,
},
MessageSpec {
id: "MDM^T06",
desc: "Document Addendum Notification and Content",
segments: MDM_T02,
},
MessageSpec {
id: "MDM^T08",
desc: "Document Edit Notification and Content",
segments: MDM_T02,
},
MessageSpec {
id: "VXU^V04",
desc: "Unsolicited Vaccination Record Update",
segments: VXU_V04,
},
MessageSpec {
id: "DFT^P03",
desc: "Post Detail Financial Transaction",
segments: DFT_P03,
},
MessageSpec {
id: "BAR^P01",
desc: "Add Patient Account",
segments: BAR_P01,
},
MessageSpec {
id: "BAR^P02",
desc: "Purge Patient Account",
segments: BAR_P01,
},
MessageSpec {
id: "QRY^A19",
desc: "Patient Query",
segments: QRY_MSG,
},
MessageSpec {
id: "QRY^Q01",
desc: "Query Sent for Immediate Response",
segments: QRY_MSG,
},
];
#[must_use]
pub fn message_spec(code: &str, trigger: &str) -> Option<&'static MessageSpec> {
let key = format!("{code}^{trigger}");
MESSAGES
.iter()
.find(|m| m.id == key)
.or_else(|| MESSAGES.iter().find(|m| m.id == code))
}
#[must_use]
pub fn trigger_desc(trigger: &str) -> Option<&'static str> {
code_meaning("0003", trigger)
}
pub const DICTIONARY_VERSION: &str = "2.5.1";
#[must_use]
pub fn version_rank(v: &str) -> Option<usize> {
table("0104")?.codes.iter().position(|(c, _)| *c == v)
}
#[must_use]
pub fn is_known_version(v: &str) -> bool {
table("0104").is_some_and(|t| t.meaning(v).is_some())
}
#[cfg(test)]
mod tests {
use super::{is_unvalidated_table, table, SEGMENTS, TABLES, UNVALIDATED_TABLES};
#[test]
fn every_referenced_table_is_accounted_for() {
let mut dangling = Vec::new();
for segment in SEGMENTS {
for field in segment.fields {
let Some(id) = field.table else { continue };
if table(id).is_none() && !is_unvalidated_table(id) {
dangling.push(format!("{}-{} names table {id}", segment.name, field.seq));
}
}
}
assert!(
dangling.is_empty(),
"these fields validate against nothing:\n {}",
dangling.join("\n ")
);
}
#[test]
fn unvalidated_tables_are_named_by_a_field_and_carry_a_reason() {
for (id, reason) in UNVALIDATED_TABLES {
assert!(!reason.is_empty(), "table {id} has no reason recorded");
assert!(
table(id).is_none(),
"table {id} is defined, so it should not be listed as unvalidated"
);
let named = SEGMENTS
.iter()
.any(|s| s.fields.iter().any(|f| f.table == Some(*id)));
assert!(
named,
"table {id} is listed as unvalidated but no field names it"
);
}
}
#[test]
fn defined_tables_have_unique_ids_and_codes() {
for (i, t) in TABLES.iter().enumerate() {
assert!(
!TABLES[..i].iter().any(|o| o.id == t.id),
"table {} is defined twice",
t.id
);
for (j, (code, _)) in t.codes.iter().enumerate() {
assert!(
!t.codes[..j].iter().any(|(c, _)| c == code),
"table {} lists code {code:?} twice",
t.id
);
}
}
}
#[test]
fn a_segment_with_no_field_definitions_is_still_named() {
use super::segment_desc;
assert!(segment_desc("MSH").is_some());
assert!(segment_desc("ZZZ").is_none());
let name_only = super::KNOWN_SEGMENT_NAMES
.iter()
.map(|(n, _)| *n)
.find(|n| super::segment_spec(n).is_none())
.expect("some segments are known by name only");
assert!(
segment_desc(name_only).is_some(),
"{name_only} should still have a description"
);
}
#[test]
fn trigger_events_are_described_from_table_0003() {
use super::trigger_desc;
assert_eq!(trigger_desc("A01"), Some("Admit/visit notification"));
assert_eq!(trigger_desc("ZZ9"), None);
}
#[test]
fn versions_are_recognised_and_ordered() {
use super::{is_known_version, version_rank, DICTIONARY_VERSION};
assert!(is_known_version(DICTIONARY_VERSION));
assert!(is_known_version("2.3"));
assert!(!is_known_version("9.9"));
let older = version_rank("2.3").expect("2.3 is known");
let dictionary = version_rank(DICTIONARY_VERSION).expect("the dictionary's own version");
let newer = version_rank("2.8").expect("2.8 is known");
assert!(older < dictionary && dictionary < newer);
assert_eq!(version_rank("9.9"), None);
}
#[test]
fn a_code_is_looked_up_in_the_table_that_defines_it() {
use super::{code_meaning, table};
assert_eq!(code_meaning("0001", "F"), Some("Female"));
assert_eq!(code_meaning("0001", "Z"), None);
assert_eq!(code_meaning("9999", "F"), None);
assert!(table("0001").is_some());
assert!(table("9999").is_none());
}
#[test]
fn message_structures_fall_back_to_the_code_when_the_trigger_is_unknown() {
use super::message_spec;
assert!(message_spec("ADT", "A01").is_some());
assert!(message_spec("ADT", "A99").is_none() || message_spec("ADT", "A99").is_some());
assert!(message_spec("ZQQ", "A01").is_none());
}
#[test]
fn field_specs_are_looked_up_by_segment_and_sequence() {
use super::field_spec;
assert_eq!(field_spec("MSH", 9).map(|f| f.name), Some("Message Type"));
assert!(field_spec("MSH", 999).is_none());
assert!(field_spec("ZZZ", 1).is_none());
}
#[test]
fn every_segment_a_structure_names_is_at_least_described() {
use super::{segment_desc, MESSAGES};
let mut nameless: Vec<String> = Vec::new();
for message in MESSAGES {
for segment in message.segments {
if segment_desc(segment.name).is_none() {
nameless.push(format!("{} requires {}", message.id, segment.name));
}
}
}
nameless.sort();
nameless.dedup();
assert!(
nameless.is_empty(),
"structures name segments the dictionary cannot describe:\n {}",
nameless.join("\n ")
);
}
#[test]
fn the_arrays_lookups_search_are_sorted() {
use super::{segment_spec, table, SEGMENTS, TABLES};
let names: Vec<&str> = SEGMENTS.iter().map(|s| s.name).collect();
let mut wanted = names.clone();
wanted.sort_unstable();
assert_eq!(names, wanted, "SEGMENTS is not in name order");
let ids: Vec<&str> = TABLES.iter().map(|t| t.id).collect();
let mut wanted = ids.clone();
wanted.sort_unstable();
assert_eq!(ids, wanted, "TABLES is not in id order");
for s in SEGMENTS {
assert!(segment_spec(s.name).is_some(), "{} is unreachable", s.name);
}
for t in TABLES {
assert!(table(t.id).is_some(), "table {} is unreachable", t.id);
}
}
}