x12_alt 0.1.0

Data types for X12 EDI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
use std::fmt;
use serde::{de, Deserialize, ser, Serialize};
/**584

See docs at <https://www.stedi.com/edi/x12-005010/element/584>*/
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum EmploymentStatusCode {
    ///00 - Substitute
    Substitute,
    ///AA - Leave of Absence with Pay
    LeaveOfAbsenceWithPay,
    ///AB - Leave of Absence without Pay
    LeaveOfAbsenceWithoutPay,
    ///AC - Active
    Active,
    ///AD - Apprenticeship Full-time
    ApprenticeshipFullTime,
    ///AE - Active Reserve
    ActiveReserve,
    ///AF - Flexible Work Plan
    FlexibleWorkPlan,
    ///AG - Alerted
    Alerted,
    ///AH - Assigned
    Assigned,
    ///AI - Affiliated with Outside Organization
    AffiliatedWithOutsideOrganization,
    ///AJ - Adjunct
    Adjunct,
    ///AO - Active Military - Overseas
    ActiveMilitaryOverseas,
    ///AP - Apprenticeship Part-time
    ApprenticeshipPartTime,
    ///AQ - Apprenticeship
    Apprenticeship,
    ///AS - Academy Student
    AcademyStudent,
    ///AT - Presidential Appointee
    PresidentialAppointee,
    ///AU - Active Military - USA
    ActiveMilitaryUsa,
    ///CA - Non-applicable Employment Status Category
    NonApplicableEmploymentStatusCategory,
    ///CC - Contractor
    Contractor,
    ///CO - Consolidated Omnibus Budget Reconciliation Act (COBRA)
    CodeCO,
    ///CT - Continued
    Continued,
    ///DC - Discharged or Terminated for Cause
    DischargedOrTerminatedForCause,
    ///DD - Dishonorably Discharged
    DishonorablyDischarged,
    ///DI - Deceased
    Deceased,
    ///DQ - Disqualified: Medical or Physical Condition
    DisqualifiedMedicalOrPhysicalCondition,
    ///DR - Disqualified: Other
    DisqualifiedOther,
    ///DS - Disabled
    Disabled,
    ///EO - Employed by Outside Organization
    EmployedByOutsideOrganization,
    ///FA - Furloughed: Job Abolished, Force Reduction
    CodeFA,
    ///FB - Furloughed: Bumped or Displaced
    FurloughedBumpedOrDisplaced,
    ///FC - Furloughed: Facility Closed
    FurloughedFacilityClosed,
    ///FO - Furloughed: Other
    FurloughedOther,
    ///FT - Full-time
    FullTime,
    ///HD - Honorably Discharged
    HonorablyDischarged,
    ///IA - Inactive
    Inactive,
    ///IR - Inactive Reserves
    InactiveReserves,
    ///L1 - Leave of Absence
    LeaveOfAbsence,
    ///L2 - Administrative Leave of Absence
    AdministrativeLeaveOfAbsence,
    ///L3 - Annual Leave of Absence
    AnnualLeaveOfAbsence,
    ///L4 - Leave of Absence due to Bereavement
    LeaveOfAbsenceDueToBereavement,
    ///L5 - Jury Duty
    JuryDuty,
    ///L6 - Suspension
    Suspension,
    ///L7 - Sabbatical Leave of Absence
    SabbaticalLeaveOfAbsence,
    ///LA - Leave of Absence: Personal
    LeaveOfAbsencePersonal,
    ///LE - Leave of Absence: Education
    LeaveOfAbsenceEducation,
    ///LF - Leave of Absence: Family Medical Leave Act (FMLA)
    CodeLF,
    ///LM - Leave of Absence: Maternity
    LeaveOfAbsenceMaternity,
    ///LO - Leave of Absence for Non-Military Government Request Other Than Jury Duty
    LeaveOfAbsenceForNonMilitaryGovernmentRequestOtherThanJuryDuty,
    ///LS - Leave of Absence: Sickness
    LeaveOfAbsenceSickness,
    ///LU - Leave of Absence: Union
    LeaveOfAbsenceUnion,
    ///LW - Leave of Absence: Without Permission, Unauthorized
    CodeLW,
    ///LX - Leave of Absence: Military
    LeaveOfAbsenceMilitary,
    ///NE - Not Employed
    NotEmployed,
    ///OS - On Strike
    OnStrike,
    ///OT - Other
    Other,
    ///PA - Promoted
    Promoted,
    ///PC - Part-time Contractual
    PartTimeContractual,
    ///PE - Plan to Enlist
    PlanToEnlist,
    ///PM - Permanent
    Permanent,
    ///PN - Part-time Noncontractual
    PartTimeNoncontractual,
    ///PR - Probationary
    Probationary,
    ///PT - Part-time
    PartTime,
    ///PV - Previous
    Previous,
    ///PW - Piece Worker
    PieceWorker,
    ///RA - Resigned: Retired
    ResignedRetired,
    ///RB - Relocated
    Relocated,
    ///RC - Reassigned
    Reassigned,
    ///RD - Resigned: Moved
    ResignedMoved,
    ///RE - Recommissioned
    Recommissioned,
    ///RI - Resigned: Injury
    ResignedInjury,
    ///RM - Retired Military - Overseas
    RetiredMilitaryOverseas,
    ///RP - Resigned: Personal Reasons
    ResignedPersonalReasons,
    ///RR - Retired Without Recall
    RetiredWithoutRecall,
    ///RT - Retired
    Retired,
    ///RU - Retired Military - USA
    RetiredMilitaryUsa,
    ///RW - Dual Retired Status
    DualRetiredStatus,
    ///SA - Resigned: Accepted Separation Allowance
    ResignedAcceptedSeparationAllowance,
    ///SB - Separated
    Separated,
    ///SE - Self-Employed
    SelfEmployed,
    ///SL - Seasonal
    Seasonal,
    ///SU - Suspended
    Suspended,
    ///TE - Terminated
    Terminated,
    ///TF - Temporary Full-Time
    TemporaryFullTime,
    ///TM - Temporary
    Temporary,
    ///TN - Tenured
    Tenured,
    ///TP - Temporary Part-Time
    TemporaryPartTime,
    ///TR - Transferred
    Transferred,
    ///UK - Unknown
    Unknown,
    ///VO - Volunteer
    Volunteer,
    ///XD - Extra Duties Not Requiring Certification
    ExtraDutiesNotRequiringCertification,
    ///ZZ - Mutually Defined
    MutuallyDefined,
}
impl EmploymentStatusCode {
    pub fn code(&self) -> &str {
        {
            use EmploymentStatusCode::*;
            match self {
                Substitute => "00",
                LeaveOfAbsenceWithPay => "AA",
                LeaveOfAbsenceWithoutPay => "AB",
                Active => "AC",
                ApprenticeshipFullTime => "AD",
                ActiveReserve => "AE",
                FlexibleWorkPlan => "AF",
                Alerted => "AG",
                Assigned => "AH",
                AffiliatedWithOutsideOrganization => "AI",
                Adjunct => "AJ",
                ActiveMilitaryOverseas => "AO",
                ApprenticeshipPartTime => "AP",
                Apprenticeship => "AQ",
                AcademyStudent => "AS",
                PresidentialAppointee => "AT",
                ActiveMilitaryUsa => "AU",
                NonApplicableEmploymentStatusCategory => "CA",
                Contractor => "CC",
                CodeCO => "CO",
                Continued => "CT",
                DischargedOrTerminatedForCause => "DC",
                DishonorablyDischarged => "DD",
                Deceased => "DI",
                DisqualifiedMedicalOrPhysicalCondition => "DQ",
                DisqualifiedOther => "DR",
                Disabled => "DS",
                EmployedByOutsideOrganization => "EO",
                CodeFA => "FA",
                FurloughedBumpedOrDisplaced => "FB",
                FurloughedFacilityClosed => "FC",
                FurloughedOther => "FO",
                FullTime => "FT",
                HonorablyDischarged => "HD",
                Inactive => "IA",
                InactiveReserves => "IR",
                LeaveOfAbsence => "L1",
                AdministrativeLeaveOfAbsence => "L2",
                AnnualLeaveOfAbsence => "L3",
                LeaveOfAbsenceDueToBereavement => "L4",
                JuryDuty => "L5",
                Suspension => "L6",
                SabbaticalLeaveOfAbsence => "L7",
                LeaveOfAbsencePersonal => "LA",
                LeaveOfAbsenceEducation => "LE",
                CodeLF => "LF",
                LeaveOfAbsenceMaternity => "LM",
                LeaveOfAbsenceForNonMilitaryGovernmentRequestOtherThanJuryDuty => "LO",
                LeaveOfAbsenceSickness => "LS",
                LeaveOfAbsenceUnion => "LU",
                CodeLW => "LW",
                LeaveOfAbsenceMilitary => "LX",
                NotEmployed => "NE",
                OnStrike => "OS",
                Other => "OT",
                Promoted => "PA",
                PartTimeContractual => "PC",
                PlanToEnlist => "PE",
                Permanent => "PM",
                PartTimeNoncontractual => "PN",
                Probationary => "PR",
                PartTime => "PT",
                Previous => "PV",
                PieceWorker => "PW",
                ResignedRetired => "RA",
                Relocated => "RB",
                Reassigned => "RC",
                ResignedMoved => "RD",
                Recommissioned => "RE",
                ResignedInjury => "RI",
                RetiredMilitaryOverseas => "RM",
                ResignedPersonalReasons => "RP",
                RetiredWithoutRecall => "RR",
                Retired => "RT",
                RetiredMilitaryUsa => "RU",
                DualRetiredStatus => "RW",
                ResignedAcceptedSeparationAllowance => "SA",
                Separated => "SB",
                SelfEmployed => "SE",
                Seasonal => "SL",
                Suspended => "SU",
                Terminated => "TE",
                TemporaryFullTime => "TF",
                Temporary => "TM",
                Tenured => "TN",
                TemporaryPartTime => "TP",
                Transferred => "TR",
                Unknown => "UK",
                Volunteer => "VO",
                ExtraDutiesNotRequiringCertification => "XD",
                MutuallyDefined => "ZZ",
            }
        }
    }
    pub fn from_code(code: &[u8]) -> Option<EmploymentStatusCode> {
        use EmploymentStatusCode::*;
        match code {
            b"00" => Some(Substitute),
            b"AA" => Some(LeaveOfAbsenceWithPay),
            b"AB" => Some(LeaveOfAbsenceWithoutPay),
            b"AC" => Some(Active),
            b"AD" => Some(ApprenticeshipFullTime),
            b"AE" => Some(ActiveReserve),
            b"AF" => Some(FlexibleWorkPlan),
            b"AG" => Some(Alerted),
            b"AH" => Some(Assigned),
            b"AI" => Some(AffiliatedWithOutsideOrganization),
            b"AJ" => Some(Adjunct),
            b"AO" => Some(ActiveMilitaryOverseas),
            b"AP" => Some(ApprenticeshipPartTime),
            b"AQ" => Some(Apprenticeship),
            b"AS" => Some(AcademyStudent),
            b"AT" => Some(PresidentialAppointee),
            b"AU" => Some(ActiveMilitaryUsa),
            b"CA" => Some(NonApplicableEmploymentStatusCategory),
            b"CC" => Some(Contractor),
            b"CO" => Some(CodeCO),
            b"CT" => Some(Continued),
            b"DC" => Some(DischargedOrTerminatedForCause),
            b"DD" => Some(DishonorablyDischarged),
            b"DI" => Some(Deceased),
            b"DQ" => Some(DisqualifiedMedicalOrPhysicalCondition),
            b"DR" => Some(DisqualifiedOther),
            b"DS" => Some(Disabled),
            b"EO" => Some(EmployedByOutsideOrganization),
            b"FA" => Some(CodeFA),
            b"FB" => Some(FurloughedBumpedOrDisplaced),
            b"FC" => Some(FurloughedFacilityClosed),
            b"FO" => Some(FurloughedOther),
            b"FT" => Some(FullTime),
            b"HD" => Some(HonorablyDischarged),
            b"IA" => Some(Inactive),
            b"IR" => Some(InactiveReserves),
            b"L1" => Some(LeaveOfAbsence),
            b"L2" => Some(AdministrativeLeaveOfAbsence),
            b"L3" => Some(AnnualLeaveOfAbsence),
            b"L4" => Some(LeaveOfAbsenceDueToBereavement),
            b"L5" => Some(JuryDuty),
            b"L6" => Some(Suspension),
            b"L7" => Some(SabbaticalLeaveOfAbsence),
            b"LA" => Some(LeaveOfAbsencePersonal),
            b"LE" => Some(LeaveOfAbsenceEducation),
            b"LF" => Some(CodeLF),
            b"LM" => Some(LeaveOfAbsenceMaternity),
            b"LO" => Some(LeaveOfAbsenceForNonMilitaryGovernmentRequestOtherThanJuryDuty),
            b"LS" => Some(LeaveOfAbsenceSickness),
            b"LU" => Some(LeaveOfAbsenceUnion),
            b"LW" => Some(CodeLW),
            b"LX" => Some(LeaveOfAbsenceMilitary),
            b"NE" => Some(NotEmployed),
            b"OS" => Some(OnStrike),
            b"OT" => Some(Other),
            b"PA" => Some(Promoted),
            b"PC" => Some(PartTimeContractual),
            b"PE" => Some(PlanToEnlist),
            b"PM" => Some(Permanent),
            b"PN" => Some(PartTimeNoncontractual),
            b"PR" => Some(Probationary),
            b"PT" => Some(PartTime),
            b"PV" => Some(Previous),
            b"PW" => Some(PieceWorker),
            b"RA" => Some(ResignedRetired),
            b"RB" => Some(Relocated),
            b"RC" => Some(Reassigned),
            b"RD" => Some(ResignedMoved),
            b"RE" => Some(Recommissioned),
            b"RI" => Some(ResignedInjury),
            b"RM" => Some(RetiredMilitaryOverseas),
            b"RP" => Some(ResignedPersonalReasons),
            b"RR" => Some(RetiredWithoutRecall),
            b"RT" => Some(Retired),
            b"RU" => Some(RetiredMilitaryUsa),
            b"RW" => Some(DualRetiredStatus),
            b"SA" => Some(ResignedAcceptedSeparationAllowance),
            b"SB" => Some(Separated),
            b"SE" => Some(SelfEmployed),
            b"SL" => Some(Seasonal),
            b"SU" => Some(Suspended),
            b"TE" => Some(Terminated),
            b"TF" => Some(TemporaryFullTime),
            b"TM" => Some(Temporary),
            b"TN" => Some(Tenured),
            b"TP" => Some(TemporaryPartTime),
            b"TR" => Some(Transferred),
            b"UK" => Some(Unknown),
            b"VO" => Some(Volunteer),
            b"XD" => Some(ExtraDutiesNotRequiringCertification),
            b"ZZ" => Some(MutuallyDefined),
            _ => None,
        }
    }
    fn description(&self) -> &str {
        use EmploymentStatusCode::*;
        match self {
            Substitute => "Substitute",
            LeaveOfAbsenceWithPay => "Leave of Absence with Pay",
            LeaveOfAbsenceWithoutPay => "Leave of Absence without Pay",
            Active => "Active",
            ApprenticeshipFullTime => "Apprenticeship Full-time",
            ActiveReserve => "Active Reserve",
            FlexibleWorkPlan => "Flexible Work Plan",
            Alerted => "Alerted",
            Assigned => "Assigned",
            AffiliatedWithOutsideOrganization => "Affiliated with Outside Organization",
            Adjunct => "Adjunct",
            ActiveMilitaryOverseas => "Active Military - Overseas",
            ApprenticeshipPartTime => "Apprenticeship Part-time",
            Apprenticeship => "Apprenticeship",
            AcademyStudent => "Academy Student",
            PresidentialAppointee => "Presidential Appointee",
            ActiveMilitaryUsa => "Active Military - USA",
            NonApplicableEmploymentStatusCategory => {
                "Non-applicable Employment Status Category"
            }
            Contractor => "Contractor",
            CodeCO => "Consolidated Omnibus Budget Reconciliation Act (COBRA)",
            Continued => "Continued",
            DischargedOrTerminatedForCause => "Discharged or Terminated for Cause",
            DishonorablyDischarged => "Dishonorably Discharged",
            Deceased => "Deceased",
            DisqualifiedMedicalOrPhysicalCondition => {
                "Disqualified: Medical or Physical Condition"
            }
            DisqualifiedOther => "Disqualified: Other",
            Disabled => "Disabled",
            EmployedByOutsideOrganization => "Employed by Outside Organization",
            CodeFA => "Furloughed: Job Abolished, Force Reduction",
            FurloughedBumpedOrDisplaced => "Furloughed: Bumped or Displaced",
            FurloughedFacilityClosed => "Furloughed: Facility Closed",
            FurloughedOther => "Furloughed: Other",
            FullTime => "Full-time",
            HonorablyDischarged => "Honorably Discharged",
            Inactive => "Inactive",
            InactiveReserves => "Inactive Reserves",
            LeaveOfAbsence => "Leave of Absence",
            AdministrativeLeaveOfAbsence => "Administrative Leave of Absence",
            AnnualLeaveOfAbsence => "Annual Leave of Absence",
            LeaveOfAbsenceDueToBereavement => "Leave of Absence due to Bereavement",
            JuryDuty => "Jury Duty",
            Suspension => "Suspension",
            SabbaticalLeaveOfAbsence => "Sabbatical Leave of Absence",
            LeaveOfAbsencePersonal => "Leave of Absence: Personal",
            LeaveOfAbsenceEducation => "Leave of Absence: Education",
            CodeLF => "Leave of Absence: Family Medical Leave Act (FMLA)",
            LeaveOfAbsenceMaternity => "Leave of Absence: Maternity",
            LeaveOfAbsenceForNonMilitaryGovernmentRequestOtherThanJuryDuty => {
                "Leave of Absence for Non-Military Government Request Other Than Jury Duty"
            }
            LeaveOfAbsenceSickness => "Leave of Absence: Sickness",
            LeaveOfAbsenceUnion => "Leave of Absence: Union",
            CodeLW => "Leave of Absence: Without Permission, Unauthorized",
            LeaveOfAbsenceMilitary => "Leave of Absence: Military",
            NotEmployed => "Not Employed",
            OnStrike => "On Strike",
            Other => "Other",
            Promoted => "Promoted",
            PartTimeContractual => "Part-time Contractual",
            PlanToEnlist => "Plan to Enlist",
            Permanent => "Permanent",
            PartTimeNoncontractual => "Part-time Noncontractual",
            Probationary => "Probationary",
            PartTime => "Part-time",
            Previous => "Previous",
            PieceWorker => "Piece Worker",
            ResignedRetired => "Resigned: Retired",
            Relocated => "Relocated",
            Reassigned => "Reassigned",
            ResignedMoved => "Resigned: Moved",
            Recommissioned => "Recommissioned",
            ResignedInjury => "Resigned: Injury",
            RetiredMilitaryOverseas => "Retired Military - Overseas",
            ResignedPersonalReasons => "Resigned: Personal Reasons",
            RetiredWithoutRecall => "Retired Without Recall",
            Retired => "Retired",
            RetiredMilitaryUsa => "Retired Military - USA",
            DualRetiredStatus => "Dual Retired Status",
            ResignedAcceptedSeparationAllowance => {
                "Resigned: Accepted Separation Allowance"
            }
            Separated => "Separated",
            SelfEmployed => "Self-Employed",
            Seasonal => "Seasonal",
            Suspended => "Suspended",
            Terminated => "Terminated",
            TemporaryFullTime => "Temporary Full-Time",
            Temporary => "Temporary",
            Tenured => "Tenured",
            TemporaryPartTime => "Temporary Part-Time",
            Transferred => "Transferred",
            Unknown => "Unknown",
            Volunteer => "Volunteer",
            ExtraDutiesNotRequiringCertification => {
                "Extra Duties Not Requiring Certification"
            }
            MutuallyDefined => "Mutually Defined",
        }
    }
    fn from_description(description: &str) -> Option<EmploymentStatusCode> {
        {
            use EmploymentStatusCode::*;
            match description {
                "Substitute" => Some(Substitute),
                "Leave of Absence with Pay" => Some(LeaveOfAbsenceWithPay),
                "Leave of Absence without Pay" => Some(LeaveOfAbsenceWithoutPay),
                "Active" => Some(Active),
                "Apprenticeship Full-time" => Some(ApprenticeshipFullTime),
                "Active Reserve" => Some(ActiveReserve),
                "Flexible Work Plan" => Some(FlexibleWorkPlan),
                "Alerted" => Some(Alerted),
                "Assigned" => Some(Assigned),
                "Affiliated with Outside Organization" => {
                    Some(AffiliatedWithOutsideOrganization)
                }
                "Adjunct" => Some(Adjunct),
                "Active Military - Overseas" => Some(ActiveMilitaryOverseas),
                "Apprenticeship Part-time" => Some(ApprenticeshipPartTime),
                "Apprenticeship" => Some(Apprenticeship),
                "Academy Student" => Some(AcademyStudent),
                "Presidential Appointee" => Some(PresidentialAppointee),
                "Active Military - USA" => Some(ActiveMilitaryUsa),
                "Non-applicable Employment Status Category" => {
                    Some(NonApplicableEmploymentStatusCategory)
                }
                "Contractor" => Some(Contractor),
                "Consolidated Omnibus Budget Reconciliation Act (COBRA)" => Some(CodeCO),
                "Continued" => Some(Continued),
                "Discharged or Terminated for Cause" => {
                    Some(DischargedOrTerminatedForCause)
                }
                "Dishonorably Discharged" => Some(DishonorablyDischarged),
                "Deceased" => Some(Deceased),
                "Disqualified: Medical or Physical Condition" => {
                    Some(DisqualifiedMedicalOrPhysicalCondition)
                }
                "Disqualified: Other" => Some(DisqualifiedOther),
                "Disabled" => Some(Disabled),
                "Employed by Outside Organization" => Some(EmployedByOutsideOrganization),
                "Furloughed: Job Abolished, Force Reduction" => Some(CodeFA),
                "Furloughed: Bumped or Displaced" => Some(FurloughedBumpedOrDisplaced),
                "Furloughed: Facility Closed" => Some(FurloughedFacilityClosed),
                "Furloughed: Other" => Some(FurloughedOther),
                "Full-time" => Some(FullTime),
                "Honorably Discharged" => Some(HonorablyDischarged),
                "Inactive" => Some(Inactive),
                "Inactive Reserves" => Some(InactiveReserves),
                "Leave of Absence" => Some(LeaveOfAbsence),
                "Administrative Leave of Absence" => Some(AdministrativeLeaveOfAbsence),
                "Annual Leave of Absence" => Some(AnnualLeaveOfAbsence),
                "Leave of Absence due to Bereavement" => {
                    Some(LeaveOfAbsenceDueToBereavement)
                }
                "Jury Duty" => Some(JuryDuty),
                "Suspension" => Some(Suspension),
                "Sabbatical Leave of Absence" => Some(SabbaticalLeaveOfAbsence),
                "Leave of Absence: Personal" => Some(LeaveOfAbsencePersonal),
                "Leave of Absence: Education" => Some(LeaveOfAbsenceEducation),
                "Leave of Absence: Family Medical Leave Act (FMLA)" => Some(CodeLF),
                "Leave of Absence: Maternity" => Some(LeaveOfAbsenceMaternity),
                "Leave of Absence for Non-Military Government Request Other Than Jury Duty" => {
                    Some(LeaveOfAbsenceForNonMilitaryGovernmentRequestOtherThanJuryDuty)
                }
                "Leave of Absence: Sickness" => Some(LeaveOfAbsenceSickness),
                "Leave of Absence: Union" => Some(LeaveOfAbsenceUnion),
                "Leave of Absence: Without Permission, Unauthorized" => Some(CodeLW),
                "Leave of Absence: Military" => Some(LeaveOfAbsenceMilitary),
                "Not Employed" => Some(NotEmployed),
                "On Strike" => Some(OnStrike),
                "Other" => Some(Other),
                "Promoted" => Some(Promoted),
                "Part-time Contractual" => Some(PartTimeContractual),
                "Plan to Enlist" => Some(PlanToEnlist),
                "Permanent" => Some(Permanent),
                "Part-time Noncontractual" => Some(PartTimeNoncontractual),
                "Probationary" => Some(Probationary),
                "Part-time" => Some(PartTime),
                "Previous" => Some(Previous),
                "Piece Worker" => Some(PieceWorker),
                "Resigned: Retired" => Some(ResignedRetired),
                "Relocated" => Some(Relocated),
                "Reassigned" => Some(Reassigned),
                "Resigned: Moved" => Some(ResignedMoved),
                "Recommissioned" => Some(Recommissioned),
                "Resigned: Injury" => Some(ResignedInjury),
                "Retired Military - Overseas" => Some(RetiredMilitaryOverseas),
                "Resigned: Personal Reasons" => Some(ResignedPersonalReasons),
                "Retired Without Recall" => Some(RetiredWithoutRecall),
                "Retired" => Some(Retired),
                "Retired Military - USA" => Some(RetiredMilitaryUsa),
                "Dual Retired Status" => Some(DualRetiredStatus),
                "Resigned: Accepted Separation Allowance" => {
                    Some(ResignedAcceptedSeparationAllowance)
                }
                "Separated" => Some(Separated),
                "Self-Employed" => Some(SelfEmployed),
                "Seasonal" => Some(Seasonal),
                "Suspended" => Some(Suspended),
                "Terminated" => Some(Terminated),
                "Temporary Full-Time" => Some(TemporaryFullTime),
                "Temporary" => Some(Temporary),
                "Tenured" => Some(Tenured),
                "Temporary Part-Time" => Some(TemporaryPartTime),
                "Transferred" => Some(Transferred),
                "Unknown" => Some(Unknown),
                "Volunteer" => Some(Volunteer),
                "Extra Duties Not Requiring Certification" => {
                    Some(ExtraDutiesNotRequiringCertification)
                }
                "Mutually Defined" => Some(MutuallyDefined),
                _ => None,
            }
        }
    }
}
impl Serialize for EmploymentStatusCode {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: ser::Serializer,
    {
        let value = if serializer.is_human_readable() {
            self.description()
        } else {
            self.code()
        };
        serializer.serialize_str(value)
    }
}
struct Visitor;
impl<'de> de::Visitor<'de> for Visitor {
    type Value = EmploymentStatusCode;
    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        formatter.write_str("Employment Status Code")
    }
    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
    where
        E: de::Error,
    {
        EmploymentStatusCode::from_description(v)
            .ok_or_else(|| E::custom(format!("Invalid Employment Status Code: {}", v)))
    }
    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
    where
        E: de::Error,
    {
        EmploymentStatusCode::from_code(v)
            .ok_or_else(|| E::custom(
                format!(
                    "Invalid Employment Status Code: {}", std::str::from_utf8(v).unwrap()
                ),
            ))
    }
}
impl<'de> Deserialize<'de> for EmploymentStatusCode {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: de::Deserializer<'de>,
    {
        if deserializer.is_human_readable() {
            deserializer.deserialize_str(Visitor)
        } else {
            deserializer.deserialize_bytes(Visitor)
        }
    }
}