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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
use std::fmt;
use serde::{de, Deserialize, ser, Serialize};
/**309

See docs at <https://www.stedi.com/edi/x12-005010/element/309>*/
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum LocationQualifier {
    ///10 - Nearest Cross Street
    NearestCrossStreet,
    ///11 - Secondary Cross Street
    SecondaryCrossStreet,
    ///12 - Range
    Range,
    ///13 - Section
    Section,
    ///14 - Quarter Section
    QuarterSection,
    ///18 - Marker Identifier Location
    MarkerIdentifierLocation,
    ///19 - Route
    Route,
    ///20 - Route Subdivision
    RouteSubdivision,
    ///21 - Grid Location
    GridLocation,
    ///22 - Page
    Page,
    ///27 - Marker Type
    MarkerType,
    ///28 - Latitude-Longitude Source
    LatitudeLongitudeSource,
    ///29 - Map Source
    MapSource,
    ///30 - Map Reference
    MapReference,
    ///31 - Grid Source
    GridSource,
    ///32 - Aliquot
    Aliquot,
    ///33 - Block
    Block,
    ///34 - District
    District,
    ///35 - Drainhole Number
    DrainholeNumber,
    ///36 - City Block
    CityBlock,
    ///38 - Footage Call Direction
    FootageCallDirection,
    ///39 - Location Direction
    LocationDirection,
    ///40 - Outer Continental Lease Location
    OuterContinentalLeaseLocation,
    ///41 - Lot
    Lot,
    ///42 - Map Quadrangle
    MapQuadrangle,
    ///43 - Principal Meridian
    PrincipalMeridian,
    ///44 - Outer Continental Shelf Area
    OuterContinentalShelfArea,
    ///45 - Outer Continental Shelf Block
    OuterContinentalShelfBlock,
    ///46 - Official Protraction Diagram
    OfficialProtractionDiagram,
    ///47 - Quarter Quarter Quarter Section
    QuarterQuarterQuarterSection,
    ///48 - Quarter Quarter Section
    QuarterQuarterSection,
    ///49 - Section Type
    SectionType,
    ///50 - Abstract
    Abstract,
    ///52 - Labor
    Labor,
    ///53 - League
    League,
    ///54 - Survey
    Survey,
    ///55 - Tier
    Tier,
    ///57 - Tract
    Tract,
    ///58 - Universal Transverse Mercator Quadrant
    UniversalTransverseMercatorQuadrant,
    ///59 - Course Direction
    CourseDirection,
    ///60 - Area
    Area,
    ///93 - Sender's Location Code
    SendersLocationCode,
    ///94 - Receiver's Location Code
    ReceiversLocationCode,
    ///A - Jurisdiction to Receive Credit for Uniform Commercial Code Filing
    JurisdictionToReceiveCreditForUniformCommercialCodeFiling,
    ///A1 - Office
    Office,
    ///AA - Annual Statements Mailing Address
    AnnualStatementsMailingAddress,
    ///AC - City and State
    CityAndState,
    ///AP - All Points
    AllPoints,
    ///AR - Armed Services Location Designation
    ArmedServicesLocationDesignation,
    ///B - Transmitting Utility
    TransmittingUtility,
    ///B1 - Branch
    Branch,
    ///BE - Business Economic Area (BEA) Region Code
    CodeBE,
    ///BL - Government Bill of Lading Office Code (GBLOC)
    CodeBL,
    ///BS - Place of Business
    PlaceOfBusiness,
    ///C - Consignor
    Consignor,
    ///C2 - Geopolitical Name Code
    GeopoliticalNameCode,
    ///CA - Country of Origin
    CountryOfOrigin,
    ///CB - Confirmation Mailing Address
    ConfirmationMailingAddress,
    ///CC - Country
    Country,
    ///CD - Canada Customs Office Code
    CanadaCustomsOfficeCode,
    ///CE - Correspondence Mailing Address
    CorrespondenceMailingAddress,
    ///CG - Congressional District
    CongressionalDistrict,
    ///CI - City
    City,
    ///CL - National Rate Basis (NRB)
    CodeCL,
    ///CM - Consolidated Metropolitan Statistical Area (CMSA)
    CodeCM,
    ///CO - County/Parish and State
    CountyParishAndState,
    ///CR - In Tank Car
    InTankCar,
    ///CS - Canadian SPLC
    CanadianSplc,
    ///CY - County/Parish
    CountyParish,
    ///D - Census Schedule D
    CensusScheduleD,
    ///DC - Distribution Center Number
    DistributionCenterNumber,
    ///DE - Destination (Shipping)
    CodeDE,
    ///DL - Delivery Location
    DeliveryLocation,
    ///DO - District Office
    DistrictOffice,
    ///DP - Department
    Department,
    ///DR - District of Residence
    DistrictOfResidence,
    ///DT - Domicile Type Code
    DomicileTypeCode,
    ///E - Uniform Commercial Code Filing Office
    UniformCommercialCodeFilingOffice,
    ///EA - Event Location
    EventLocation,
    ///EB - Borough
    Borough,
    ///EL - Employer Location
    EmployerLocation,
    ///F - Current Address
    CurrentAddress,
    ///FA - Factory
    Factory,
    ///FE - Freight Equalization Point
    FreightEqualizationPoint,
    ///FF - Foreign Freight Forwarder Location
    ForeignFreightForwarderLocation,
    ///FI - Federal Information Processing Standards (FIPS) 55 (Named Populated Places)
    CodeFI,
    ///FR - U.S. Custom's Facilities Information and Resource Management Systems (FIRMS)
    CodeFR,
    ///FS - Freight Station Accounting Code
    FreightStationAccountingCode,
    ///FT - Foreign Trade Zone
    ForeignTradeZone,
    ///FV - Free Alongside Vessel (Free On Board [F.O.B.] Point)
    CodeFV,
    ///G - Census Block Group
    CensusBlockGroup,
    ///GL - Freight Station Geographic Location
    FreightStationGeographicLocation,
    ///H - Home Address
    HomeAddress,
    ///I - Home Base Address
    HomeBaseAddress,
    ///IA - International Air Transport Association (IATA) Location Qualifier
    CodeIA,
    ///IB - Issue Location
    IssueLocation,
    ///IM - Military Standard Movement Procedures (MILSTAMP)
    CodeIM,
    ///IP - Postal
    Postal,
    ///IS - In Store
    InStore,
    ///IT - Intermediate FOB Point
    IntermediateFobPoint,
    ///J - Census Tract
    CensusTract,
    ///K - Census Schedule K
    CensusScheduleK,
    ///KE - Port of Embarkation
    PortOfEmbarkation,
    ///KL - Port of Loading
    PortOfLoading,
    ///KP - Government Furnished Property FOB Point
    GovernmentFurnishedPropertyFobPoint,
    ///L - Local Address
    LocalAddress,
    ///LO - Local Office
    LocalOffice,
    ///M - Mailing Address
    MailingAddress,
    ///MI - Mill
    Mill,
    ///MO - Main Campus
    MainCampus,
    ///MS - Metropolitan Sampling Area (MSA) Region Code
    CodeMS,
    ///MZ - Mexican Postal Code
    MexicanPostalCode,
    ///NS - City/State from Points
    CityStateFromPoints,
    ///O - Office Address
    OfficeAddress,
    ///OA - Origin (After Loading on Equipment)
    CodeOA,
    ///OF - Other Unlisted Free On Board (FOB) Point
    CodeOF,
    ///OL - Open and Prepay Station List Code(SCAC & Number)
    CodeOL,
    ///OP - Other Unlisted Acceptance Point
    OtherUnlistedAcceptancePoint,
    ///OR - Origin (Shipping Point)
    CodeOR,
    ///OV - On Vessel (Free On Board [FOB] point)
    CodeOV,
    ///P - Permanent Address
    PermanentAddress,
    ///PA - Port of Arrival
    PortOfArrival,
    ///PB - Port of Discharge
    PortOfDischarge,
    ///PC - Policy Mailing Address
    PolicyMailingAddress,
    ///PD - Place of Delivery
    PlaceOfDelivery,
    ///PE - Port of Entry
    PortOfEntry,
    ///PF - Parents Address
    ParentsAddress,
    ///PG - Primary
    Primary,
    ///PH - Prior Business
    PriorBusiness,
    ///PL - Plant
    Plant,
    ///PM - Primary Metropolitan Statistical Area (PMSA)
    CodePM,
    ///PO - Principal Servicing Office
    PrincipalServicingOffice,
    ///PP - Pool Point
    PoolPoint,
    ///PQ - 3 Digit U.S. ZIP
    CodePQ,
    ///PR - 4 Digit U.S. ZIP
    CodePR,
    ///PS - 5 Digit U.S. ZIP
    CodePS,
    ///PT - 3 Digit Canadian Postal Code
    CodePT,
    ///PU - 6 Digit Canadian Postal Code
    CodePU,
    ///PV - 9 DIGIT U.S. ZIP
    CodePV,
    ///PZ - 11 DIGIT U.S. ZIP
    CodePZ,
    ///Q - Birthplace
    Birthplace,
    ///RA - Rate Area Code
    RateAreaCode,
    ///RC - In Rail Car
    InRailCar,
    ///RE - Regional Education Service Agency
    RegionalEducationServiceAgency,
    ///RG - Region Code
    RegionCode,
    ///RJ - Region
    Region,
    ///RL - Rural
    Rural,
    ///RS - Standard Carrier Alpha Code
    StandardCarrierAlphaCode,
    ///RT - Route Administrative Message To
    RouteAdministrativeMessageTo,
    ///SA - Secondary
    Secondary,
    ///SB - Suburban
    Suburban,
    ///SC - City/State and Points Within
    CityStateAndPointsWithin,
    ///SD - School District
    SchoolDistrict,
    ///SE - Summer
    Summer,
    ///SG - Storage
    Storage,
    ///SH - School Campus Code
    SchoolCampusCode,
    ///SL - U.S. SPLC
    USSplc,
    ///SN - Store Number
    StoreNumber,
    ///SP - State/Province
    StateProvince,
    ///SS - School
    School,
    ///ST - In Storage Tank
    InStorageTank,
    ///SW - Switching District
    SwitchingDistrict,
    ///TA - Tank
    Tank,
    ///TC - Transcontinental Freight Bureau
    TranscontinentalFreightBureau,
    ///TI - Tribal Land
    TribalLand,
    ///TL - Terminal Cargo Location
    TerminalCargoLocation,
    ///TM - Terminal
    Terminal,
    ///TN - Township
    Township,
    ///TP - Temporary
    Temporary,
    ///TR - Rail Territory
    RailTerritory,
    ///TX - Taxing District
    TaxingDistrict,
    ///UN - United Nations Location Code (UNLOCODE)
    CodeUN,
    ///UR - Urban
    Urban,
    ///UT - Business Unit
    BusinessUnit,
    ///VA - Vacation
    Vacation,
    ///VI - Village
    Village,
    ///VS - Vessel Stowage Location
    VesselStowageLocation,
    ///W - Worldwide Geographic Location Code
    WorldwideGeographicLocationCode,
    ///WF - Wharf
    Wharf,
    ///WH - Warehouse
    Warehouse,
    ///WI - Winter
    Winter,
    ///X1 - National Center for Education Statistics Locale Code
    NationalCenterForEducationStatisticsLocaleCode,
    ///ZN - Zone Code
    ZoneCode,
    ///ZZ - Mutually Defined
    MutuallyDefined,
}
impl LocationQualifier {
    pub fn code(&self) -> &str {
        {
            use LocationQualifier::*;
            match self {
                NearestCrossStreet => "10",
                SecondaryCrossStreet => "11",
                Range => "12",
                Section => "13",
                QuarterSection => "14",
                MarkerIdentifierLocation => "18",
                Route => "19",
                RouteSubdivision => "20",
                GridLocation => "21",
                Page => "22",
                MarkerType => "27",
                LatitudeLongitudeSource => "28",
                MapSource => "29",
                MapReference => "30",
                GridSource => "31",
                Aliquot => "32",
                Block => "33",
                District => "34",
                DrainholeNumber => "35",
                CityBlock => "36",
                FootageCallDirection => "38",
                LocationDirection => "39",
                OuterContinentalLeaseLocation => "40",
                Lot => "41",
                MapQuadrangle => "42",
                PrincipalMeridian => "43",
                OuterContinentalShelfArea => "44",
                OuterContinentalShelfBlock => "45",
                OfficialProtractionDiagram => "46",
                QuarterQuarterQuarterSection => "47",
                QuarterQuarterSection => "48",
                SectionType => "49",
                Abstract => "50",
                Labor => "52",
                League => "53",
                Survey => "54",
                Tier => "55",
                Tract => "57",
                UniversalTransverseMercatorQuadrant => "58",
                CourseDirection => "59",
                Area => "60",
                SendersLocationCode => "93",
                ReceiversLocationCode => "94",
                JurisdictionToReceiveCreditForUniformCommercialCodeFiling => "A",
                Office => "A1",
                AnnualStatementsMailingAddress => "AA",
                CityAndState => "AC",
                AllPoints => "AP",
                ArmedServicesLocationDesignation => "AR",
                TransmittingUtility => "B",
                Branch => "B1",
                CodeBE => "BE",
                CodeBL => "BL",
                PlaceOfBusiness => "BS",
                Consignor => "C",
                GeopoliticalNameCode => "C2",
                CountryOfOrigin => "CA",
                ConfirmationMailingAddress => "CB",
                Country => "CC",
                CanadaCustomsOfficeCode => "CD",
                CorrespondenceMailingAddress => "CE",
                CongressionalDistrict => "CG",
                City => "CI",
                CodeCL => "CL",
                CodeCM => "CM",
                CountyParishAndState => "CO",
                InTankCar => "CR",
                CanadianSplc => "CS",
                CountyParish => "CY",
                CensusScheduleD => "D",
                DistributionCenterNumber => "DC",
                CodeDE => "DE",
                DeliveryLocation => "DL",
                DistrictOffice => "DO",
                Department => "DP",
                DistrictOfResidence => "DR",
                DomicileTypeCode => "DT",
                UniformCommercialCodeFilingOffice => "E",
                EventLocation => "EA",
                Borough => "EB",
                EmployerLocation => "EL",
                CurrentAddress => "F",
                Factory => "FA",
                FreightEqualizationPoint => "FE",
                ForeignFreightForwarderLocation => "FF",
                CodeFI => "FI",
                CodeFR => "FR",
                FreightStationAccountingCode => "FS",
                ForeignTradeZone => "FT",
                CodeFV => "FV",
                CensusBlockGroup => "G",
                FreightStationGeographicLocation => "GL",
                HomeAddress => "H",
                HomeBaseAddress => "I",
                CodeIA => "IA",
                IssueLocation => "IB",
                CodeIM => "IM",
                Postal => "IP",
                InStore => "IS",
                IntermediateFobPoint => "IT",
                CensusTract => "J",
                CensusScheduleK => "K",
                PortOfEmbarkation => "KE",
                PortOfLoading => "KL",
                GovernmentFurnishedPropertyFobPoint => "KP",
                LocalAddress => "L",
                LocalOffice => "LO",
                MailingAddress => "M",
                Mill => "MI",
                MainCampus => "MO",
                CodeMS => "MS",
                MexicanPostalCode => "MZ",
                CityStateFromPoints => "NS",
                OfficeAddress => "O",
                CodeOA => "OA",
                CodeOF => "OF",
                CodeOL => "OL",
                OtherUnlistedAcceptancePoint => "OP",
                CodeOR => "OR",
                CodeOV => "OV",
                PermanentAddress => "P",
                PortOfArrival => "PA",
                PortOfDischarge => "PB",
                PolicyMailingAddress => "PC",
                PlaceOfDelivery => "PD",
                PortOfEntry => "PE",
                ParentsAddress => "PF",
                Primary => "PG",
                PriorBusiness => "PH",
                Plant => "PL",
                CodePM => "PM",
                PrincipalServicingOffice => "PO",
                PoolPoint => "PP",
                CodePQ => "PQ",
                CodePR => "PR",
                CodePS => "PS",
                CodePT => "PT",
                CodePU => "PU",
                CodePV => "PV",
                CodePZ => "PZ",
                Birthplace => "Q",
                RateAreaCode => "RA",
                InRailCar => "RC",
                RegionalEducationServiceAgency => "RE",
                RegionCode => "RG",
                Region => "RJ",
                Rural => "RL",
                StandardCarrierAlphaCode => "RS",
                RouteAdministrativeMessageTo => "RT",
                Secondary => "SA",
                Suburban => "SB",
                CityStateAndPointsWithin => "SC",
                SchoolDistrict => "SD",
                Summer => "SE",
                Storage => "SG",
                SchoolCampusCode => "SH",
                USSplc => "SL",
                StoreNumber => "SN",
                StateProvince => "SP",
                School => "SS",
                InStorageTank => "ST",
                SwitchingDistrict => "SW",
                Tank => "TA",
                TranscontinentalFreightBureau => "TC",
                TribalLand => "TI",
                TerminalCargoLocation => "TL",
                Terminal => "TM",
                Township => "TN",
                Temporary => "TP",
                RailTerritory => "TR",
                TaxingDistrict => "TX",
                CodeUN => "UN",
                Urban => "UR",
                BusinessUnit => "UT",
                Vacation => "VA",
                Village => "VI",
                VesselStowageLocation => "VS",
                WorldwideGeographicLocationCode => "W",
                Wharf => "WF",
                Warehouse => "WH",
                Winter => "WI",
                NationalCenterForEducationStatisticsLocaleCode => "X1",
                ZoneCode => "ZN",
                MutuallyDefined => "ZZ",
            }
        }
    }
    pub fn from_code(code: &[u8]) -> Option<LocationQualifier> {
        use LocationQualifier::*;
        match code {
            b"10" => Some(NearestCrossStreet),
            b"11" => Some(SecondaryCrossStreet),
            b"12" => Some(Range),
            b"13" => Some(Section),
            b"14" => Some(QuarterSection),
            b"18" => Some(MarkerIdentifierLocation),
            b"19" => Some(Route),
            b"20" => Some(RouteSubdivision),
            b"21" => Some(GridLocation),
            b"22" => Some(Page),
            b"27" => Some(MarkerType),
            b"28" => Some(LatitudeLongitudeSource),
            b"29" => Some(MapSource),
            b"30" => Some(MapReference),
            b"31" => Some(GridSource),
            b"32" => Some(Aliquot),
            b"33" => Some(Block),
            b"34" => Some(District),
            b"35" => Some(DrainholeNumber),
            b"36" => Some(CityBlock),
            b"38" => Some(FootageCallDirection),
            b"39" => Some(LocationDirection),
            b"40" => Some(OuterContinentalLeaseLocation),
            b"41" => Some(Lot),
            b"42" => Some(MapQuadrangle),
            b"43" => Some(PrincipalMeridian),
            b"44" => Some(OuterContinentalShelfArea),
            b"45" => Some(OuterContinentalShelfBlock),
            b"46" => Some(OfficialProtractionDiagram),
            b"47" => Some(QuarterQuarterQuarterSection),
            b"48" => Some(QuarterQuarterSection),
            b"49" => Some(SectionType),
            b"50" => Some(Abstract),
            b"52" => Some(Labor),
            b"53" => Some(League),
            b"54" => Some(Survey),
            b"55" => Some(Tier),
            b"57" => Some(Tract),
            b"58" => Some(UniversalTransverseMercatorQuadrant),
            b"59" => Some(CourseDirection),
            b"60" => Some(Area),
            b"93" => Some(SendersLocationCode),
            b"94" => Some(ReceiversLocationCode),
            b"A" => Some(JurisdictionToReceiveCreditForUniformCommercialCodeFiling),
            b"A1" => Some(Office),
            b"AA" => Some(AnnualStatementsMailingAddress),
            b"AC" => Some(CityAndState),
            b"AP" => Some(AllPoints),
            b"AR" => Some(ArmedServicesLocationDesignation),
            b"B" => Some(TransmittingUtility),
            b"B1" => Some(Branch),
            b"BE" => Some(CodeBE),
            b"BL" => Some(CodeBL),
            b"BS" => Some(PlaceOfBusiness),
            b"C" => Some(Consignor),
            b"C2" => Some(GeopoliticalNameCode),
            b"CA" => Some(CountryOfOrigin),
            b"CB" => Some(ConfirmationMailingAddress),
            b"CC" => Some(Country),
            b"CD" => Some(CanadaCustomsOfficeCode),
            b"CE" => Some(CorrespondenceMailingAddress),
            b"CG" => Some(CongressionalDistrict),
            b"CI" => Some(City),
            b"CL" => Some(CodeCL),
            b"CM" => Some(CodeCM),
            b"CO" => Some(CountyParishAndState),
            b"CR" => Some(InTankCar),
            b"CS" => Some(CanadianSplc),
            b"CY" => Some(CountyParish),
            b"D" => Some(CensusScheduleD),
            b"DC" => Some(DistributionCenterNumber),
            b"DE" => Some(CodeDE),
            b"DL" => Some(DeliveryLocation),
            b"DO" => Some(DistrictOffice),
            b"DP" => Some(Department),
            b"DR" => Some(DistrictOfResidence),
            b"DT" => Some(DomicileTypeCode),
            b"E" => Some(UniformCommercialCodeFilingOffice),
            b"EA" => Some(EventLocation),
            b"EB" => Some(Borough),
            b"EL" => Some(EmployerLocation),
            b"F" => Some(CurrentAddress),
            b"FA" => Some(Factory),
            b"FE" => Some(FreightEqualizationPoint),
            b"FF" => Some(ForeignFreightForwarderLocation),
            b"FI" => Some(CodeFI),
            b"FR" => Some(CodeFR),
            b"FS" => Some(FreightStationAccountingCode),
            b"FT" => Some(ForeignTradeZone),
            b"FV" => Some(CodeFV),
            b"G" => Some(CensusBlockGroup),
            b"GL" => Some(FreightStationGeographicLocation),
            b"H" => Some(HomeAddress),
            b"I" => Some(HomeBaseAddress),
            b"IA" => Some(CodeIA),
            b"IB" => Some(IssueLocation),
            b"IM" => Some(CodeIM),
            b"IP" => Some(Postal),
            b"IS" => Some(InStore),
            b"IT" => Some(IntermediateFobPoint),
            b"J" => Some(CensusTract),
            b"K" => Some(CensusScheduleK),
            b"KE" => Some(PortOfEmbarkation),
            b"KL" => Some(PortOfLoading),
            b"KP" => Some(GovernmentFurnishedPropertyFobPoint),
            b"L" => Some(LocalAddress),
            b"LO" => Some(LocalOffice),
            b"M" => Some(MailingAddress),
            b"MI" => Some(Mill),
            b"MO" => Some(MainCampus),
            b"MS" => Some(CodeMS),
            b"MZ" => Some(MexicanPostalCode),
            b"NS" => Some(CityStateFromPoints),
            b"O" => Some(OfficeAddress),
            b"OA" => Some(CodeOA),
            b"OF" => Some(CodeOF),
            b"OL" => Some(CodeOL),
            b"OP" => Some(OtherUnlistedAcceptancePoint),
            b"OR" => Some(CodeOR),
            b"OV" => Some(CodeOV),
            b"P" => Some(PermanentAddress),
            b"PA" => Some(PortOfArrival),
            b"PB" => Some(PortOfDischarge),
            b"PC" => Some(PolicyMailingAddress),
            b"PD" => Some(PlaceOfDelivery),
            b"PE" => Some(PortOfEntry),
            b"PF" => Some(ParentsAddress),
            b"PG" => Some(Primary),
            b"PH" => Some(PriorBusiness),
            b"PL" => Some(Plant),
            b"PM" => Some(CodePM),
            b"PO" => Some(PrincipalServicingOffice),
            b"PP" => Some(PoolPoint),
            b"PQ" => Some(CodePQ),
            b"PR" => Some(CodePR),
            b"PS" => Some(CodePS),
            b"PT" => Some(CodePT),
            b"PU" => Some(CodePU),
            b"PV" => Some(CodePV),
            b"PZ" => Some(CodePZ),
            b"Q" => Some(Birthplace),
            b"RA" => Some(RateAreaCode),
            b"RC" => Some(InRailCar),
            b"RE" => Some(RegionalEducationServiceAgency),
            b"RG" => Some(RegionCode),
            b"RJ" => Some(Region),
            b"RL" => Some(Rural),
            b"RS" => Some(StandardCarrierAlphaCode),
            b"RT" => Some(RouteAdministrativeMessageTo),
            b"SA" => Some(Secondary),
            b"SB" => Some(Suburban),
            b"SC" => Some(CityStateAndPointsWithin),
            b"SD" => Some(SchoolDistrict),
            b"SE" => Some(Summer),
            b"SG" => Some(Storage),
            b"SH" => Some(SchoolCampusCode),
            b"SL" => Some(USSplc),
            b"SN" => Some(StoreNumber),
            b"SP" => Some(StateProvince),
            b"SS" => Some(School),
            b"ST" => Some(InStorageTank),
            b"SW" => Some(SwitchingDistrict),
            b"TA" => Some(Tank),
            b"TC" => Some(TranscontinentalFreightBureau),
            b"TI" => Some(TribalLand),
            b"TL" => Some(TerminalCargoLocation),
            b"TM" => Some(Terminal),
            b"TN" => Some(Township),
            b"TP" => Some(Temporary),
            b"TR" => Some(RailTerritory),
            b"TX" => Some(TaxingDistrict),
            b"UN" => Some(CodeUN),
            b"UR" => Some(Urban),
            b"UT" => Some(BusinessUnit),
            b"VA" => Some(Vacation),
            b"VI" => Some(Village),
            b"VS" => Some(VesselStowageLocation),
            b"W" => Some(WorldwideGeographicLocationCode),
            b"WF" => Some(Wharf),
            b"WH" => Some(Warehouse),
            b"WI" => Some(Winter),
            b"X1" => Some(NationalCenterForEducationStatisticsLocaleCode),
            b"ZN" => Some(ZoneCode),
            b"ZZ" => Some(MutuallyDefined),
            _ => None,
        }
    }
    fn description(&self) -> &str {
        use LocationQualifier::*;
        match self {
            NearestCrossStreet => "Nearest Cross Street",
            SecondaryCrossStreet => "Secondary Cross Street",
            Range => "Range",
            Section => "Section",
            QuarterSection => "Quarter Section",
            MarkerIdentifierLocation => "Marker Identifier Location",
            Route => "Route",
            RouteSubdivision => "Route Subdivision",
            GridLocation => "Grid Location",
            Page => "Page",
            MarkerType => "Marker Type",
            LatitudeLongitudeSource => "Latitude-Longitude Source",
            MapSource => "Map Source",
            MapReference => "Map Reference",
            GridSource => "Grid Source",
            Aliquot => "Aliquot",
            Block => "Block",
            District => "District",
            DrainholeNumber => "Drainhole Number",
            CityBlock => "City Block",
            FootageCallDirection => "Footage Call Direction",
            LocationDirection => "Location Direction",
            OuterContinentalLeaseLocation => "Outer Continental Lease Location",
            Lot => "Lot",
            MapQuadrangle => "Map Quadrangle",
            PrincipalMeridian => "Principal Meridian",
            OuterContinentalShelfArea => "Outer Continental Shelf Area",
            OuterContinentalShelfBlock => "Outer Continental Shelf Block",
            OfficialProtractionDiagram => "Official Protraction Diagram",
            QuarterQuarterQuarterSection => "Quarter Quarter Quarter Section",
            QuarterQuarterSection => "Quarter Quarter Section",
            SectionType => "Section Type",
            Abstract => "Abstract",
            Labor => "Labor",
            League => "League",
            Survey => "Survey",
            Tier => "Tier",
            Tract => "Tract",
            UniversalTransverseMercatorQuadrant => {
                "Universal Transverse Mercator Quadrant"
            }
            CourseDirection => "Course Direction",
            Area => "Area",
            SendersLocationCode => "Sender's Location Code",
            ReceiversLocationCode => "Receiver's Location Code",
            JurisdictionToReceiveCreditForUniformCommercialCodeFiling => {
                "Jurisdiction to Receive Credit for Uniform Commercial Code Filing"
            }
            Office => "Office",
            AnnualStatementsMailingAddress => "Annual Statements Mailing Address",
            CityAndState => "City and State",
            AllPoints => "All Points",
            ArmedServicesLocationDesignation => "Armed Services Location Designation",
            TransmittingUtility => "Transmitting Utility",
            Branch => "Branch",
            CodeBE => "Business Economic Area (BEA) Region Code",
            CodeBL => "Government Bill of Lading Office Code (GBLOC)",
            PlaceOfBusiness => "Place of Business",
            Consignor => "Consignor",
            GeopoliticalNameCode => "Geopolitical Name Code",
            CountryOfOrigin => "Country of Origin",
            ConfirmationMailingAddress => "Confirmation Mailing Address",
            Country => "Country",
            CanadaCustomsOfficeCode => "Canada Customs Office Code",
            CorrespondenceMailingAddress => "Correspondence Mailing Address",
            CongressionalDistrict => "Congressional District",
            City => "City",
            CodeCL => "National Rate Basis (NRB)",
            CodeCM => "Consolidated Metropolitan Statistical Area (CMSA)",
            CountyParishAndState => "County/Parish and State",
            InTankCar => "In Tank Car",
            CanadianSplc => "Canadian SPLC",
            CountyParish => "County/Parish",
            CensusScheduleD => "Census Schedule D",
            DistributionCenterNumber => "Distribution Center Number",
            CodeDE => "Destination (Shipping)",
            DeliveryLocation => "Delivery Location",
            DistrictOffice => "District Office",
            Department => "Department",
            DistrictOfResidence => "District of Residence",
            DomicileTypeCode => "Domicile Type Code",
            UniformCommercialCodeFilingOffice => "Uniform Commercial Code Filing Office",
            EventLocation => "Event Location",
            Borough => "Borough",
            EmployerLocation => "Employer Location",
            CurrentAddress => "Current Address",
            Factory => "Factory",
            FreightEqualizationPoint => "Freight Equalization Point",
            ForeignFreightForwarderLocation => "Foreign Freight Forwarder Location",
            CodeFI => {
                "Federal Information Processing Standards (FIPS) 55 (Named Populated Places)"
            }
            CodeFR => {
                "U.S. Custom's Facilities Information and Resource Management Systems (FIRMS)"
            }
            FreightStationAccountingCode => "Freight Station Accounting Code",
            ForeignTradeZone => "Foreign Trade Zone",
            CodeFV => "Free Alongside Vessel (Free On Board [F.O.B.] Point)",
            CensusBlockGroup => "Census Block Group",
            FreightStationGeographicLocation => "Freight Station Geographic Location",
            HomeAddress => "Home Address",
            HomeBaseAddress => "Home Base Address",
            CodeIA => "International Air Transport Association (IATA) Location Qualifier",
            IssueLocation => "Issue Location",
            CodeIM => "Military Standard Movement Procedures (MILSTAMP)",
            Postal => "Postal",
            InStore => "In Store",
            IntermediateFobPoint => "Intermediate FOB Point",
            CensusTract => "Census Tract",
            CensusScheduleK => "Census Schedule K",
            PortOfEmbarkation => "Port of Embarkation",
            PortOfLoading => "Port of Loading",
            GovernmentFurnishedPropertyFobPoint => {
                "Government Furnished Property FOB Point"
            }
            LocalAddress => "Local Address",
            LocalOffice => "Local Office",
            MailingAddress => "Mailing Address",
            Mill => "Mill",
            MainCampus => "Main Campus",
            CodeMS => "Metropolitan Sampling Area (MSA) Region Code",
            MexicanPostalCode => "Mexican Postal Code",
            CityStateFromPoints => "City/State from Points",
            OfficeAddress => "Office Address",
            CodeOA => "Origin (After Loading on Equipment)",
            CodeOF => "Other Unlisted Free On Board (FOB) Point",
            CodeOL => "Open and Prepay Station List Code(SCAC & Number)",
            OtherUnlistedAcceptancePoint => "Other Unlisted Acceptance Point",
            CodeOR => "Origin (Shipping Point)",
            CodeOV => "On Vessel (Free On Board [FOB] point)",
            PermanentAddress => "Permanent Address",
            PortOfArrival => "Port of Arrival",
            PortOfDischarge => "Port of Discharge",
            PolicyMailingAddress => "Policy Mailing Address",
            PlaceOfDelivery => "Place of Delivery",
            PortOfEntry => "Port of Entry",
            ParentsAddress => "Parents Address",
            Primary => "Primary",
            PriorBusiness => "Prior Business",
            Plant => "Plant",
            CodePM => "Primary Metropolitan Statistical Area (PMSA)",
            PrincipalServicingOffice => "Principal Servicing Office",
            PoolPoint => "Pool Point",
            CodePQ => "3 Digit U.S. ZIP",
            CodePR => "4 Digit U.S. ZIP",
            CodePS => "5 Digit U.S. ZIP",
            CodePT => "3 Digit Canadian Postal Code",
            CodePU => "6 Digit Canadian Postal Code",
            CodePV => "9 DIGIT U.S. ZIP",
            CodePZ => "11 DIGIT U.S. ZIP",
            Birthplace => "Birthplace",
            RateAreaCode => "Rate Area Code",
            InRailCar => "In Rail Car",
            RegionalEducationServiceAgency => "Regional Education Service Agency",
            RegionCode => "Region Code",
            Region => "Region",
            Rural => "Rural",
            StandardCarrierAlphaCode => "Standard Carrier Alpha Code",
            RouteAdministrativeMessageTo => "Route Administrative Message To",
            Secondary => "Secondary",
            Suburban => "Suburban",
            CityStateAndPointsWithin => "City/State and Points Within",
            SchoolDistrict => "School District",
            Summer => "Summer",
            Storage => "Storage",
            SchoolCampusCode => "School Campus Code",
            USSplc => "U.S. SPLC",
            StoreNumber => "Store Number",
            StateProvince => "State/Province",
            School => "School",
            InStorageTank => "In Storage Tank",
            SwitchingDistrict => "Switching District",
            Tank => "Tank",
            TranscontinentalFreightBureau => "Transcontinental Freight Bureau",
            TribalLand => "Tribal Land",
            TerminalCargoLocation => "Terminal Cargo Location",
            Terminal => "Terminal",
            Township => "Township",
            Temporary => "Temporary",
            RailTerritory => "Rail Territory",
            TaxingDistrict => "Taxing District",
            CodeUN => "United Nations Location Code (UNLOCODE)",
            Urban => "Urban",
            BusinessUnit => "Business Unit",
            Vacation => "Vacation",
            Village => "Village",
            VesselStowageLocation => "Vessel Stowage Location",
            WorldwideGeographicLocationCode => "Worldwide Geographic Location Code",
            Wharf => "Wharf",
            Warehouse => "Warehouse",
            Winter => "Winter",
            NationalCenterForEducationStatisticsLocaleCode => {
                "National Center for Education Statistics Locale Code"
            }
            ZoneCode => "Zone Code",
            MutuallyDefined => "Mutually Defined",
        }
    }
    fn from_description(description: &str) -> Option<LocationQualifier> {
        {
            use LocationQualifier::*;
            match description {
                "Nearest Cross Street" => Some(NearestCrossStreet),
                "Secondary Cross Street" => Some(SecondaryCrossStreet),
                "Range" => Some(Range),
                "Section" => Some(Section),
                "Quarter Section" => Some(QuarterSection),
                "Marker Identifier Location" => Some(MarkerIdentifierLocation),
                "Route" => Some(Route),
                "Route Subdivision" => Some(RouteSubdivision),
                "Grid Location" => Some(GridLocation),
                "Page" => Some(Page),
                "Marker Type" => Some(MarkerType),
                "Latitude-Longitude Source" => Some(LatitudeLongitudeSource),
                "Map Source" => Some(MapSource),
                "Map Reference" => Some(MapReference),
                "Grid Source" => Some(GridSource),
                "Aliquot" => Some(Aliquot),
                "Block" => Some(Block),
                "District" => Some(District),
                "Drainhole Number" => Some(DrainholeNumber),
                "City Block" => Some(CityBlock),
                "Footage Call Direction" => Some(FootageCallDirection),
                "Location Direction" => Some(LocationDirection),
                "Outer Continental Lease Location" => Some(OuterContinentalLeaseLocation),
                "Lot" => Some(Lot),
                "Map Quadrangle" => Some(MapQuadrangle),
                "Principal Meridian" => Some(PrincipalMeridian),
                "Outer Continental Shelf Area" => Some(OuterContinentalShelfArea),
                "Outer Continental Shelf Block" => Some(OuterContinentalShelfBlock),
                "Official Protraction Diagram" => Some(OfficialProtractionDiagram),
                "Quarter Quarter Quarter Section" => Some(QuarterQuarterQuarterSection),
                "Quarter Quarter Section" => Some(QuarterQuarterSection),
                "Section Type" => Some(SectionType),
                "Abstract" => Some(Abstract),
                "Labor" => Some(Labor),
                "League" => Some(League),
                "Survey" => Some(Survey),
                "Tier" => Some(Tier),
                "Tract" => Some(Tract),
                "Universal Transverse Mercator Quadrant" => {
                    Some(UniversalTransverseMercatorQuadrant)
                }
                "Course Direction" => Some(CourseDirection),
                "Area" => Some(Area),
                "Sender's Location Code" => Some(SendersLocationCode),
                "Receiver's Location Code" => Some(ReceiversLocationCode),
                "Jurisdiction to Receive Credit for Uniform Commercial Code Filing" => {
                    Some(JurisdictionToReceiveCreditForUniformCommercialCodeFiling)
                }
                "Office" => Some(Office),
                "Annual Statements Mailing Address" => {
                    Some(AnnualStatementsMailingAddress)
                }
                "City and State" => Some(CityAndState),
                "All Points" => Some(AllPoints),
                "Armed Services Location Designation" => {
                    Some(ArmedServicesLocationDesignation)
                }
                "Transmitting Utility" => Some(TransmittingUtility),
                "Branch" => Some(Branch),
                "Business Economic Area (BEA) Region Code" => Some(CodeBE),
                "Government Bill of Lading Office Code (GBLOC)" => Some(CodeBL),
                "Place of Business" => Some(PlaceOfBusiness),
                "Consignor" => Some(Consignor),
                "Geopolitical Name Code" => Some(GeopoliticalNameCode),
                "Country of Origin" => Some(CountryOfOrigin),
                "Confirmation Mailing Address" => Some(ConfirmationMailingAddress),
                "Country" => Some(Country),
                "Canada Customs Office Code" => Some(CanadaCustomsOfficeCode),
                "Correspondence Mailing Address" => Some(CorrespondenceMailingAddress),
                "Congressional District" => Some(CongressionalDistrict),
                "City" => Some(City),
                "National Rate Basis (NRB)" => Some(CodeCL),
                "Consolidated Metropolitan Statistical Area (CMSA)" => Some(CodeCM),
                "County/Parish and State" => Some(CountyParishAndState),
                "In Tank Car" => Some(InTankCar),
                "Canadian SPLC" => Some(CanadianSplc),
                "County/Parish" => Some(CountyParish),
                "Census Schedule D" => Some(CensusScheduleD),
                "Distribution Center Number" => Some(DistributionCenterNumber),
                "Destination (Shipping)" => Some(CodeDE),
                "Delivery Location" => Some(DeliveryLocation),
                "District Office" => Some(DistrictOffice),
                "Department" => Some(Department),
                "District of Residence" => Some(DistrictOfResidence),
                "Domicile Type Code" => Some(DomicileTypeCode),
                "Uniform Commercial Code Filing Office" => {
                    Some(UniformCommercialCodeFilingOffice)
                }
                "Event Location" => Some(EventLocation),
                "Borough" => Some(Borough),
                "Employer Location" => Some(EmployerLocation),
                "Current Address" => Some(CurrentAddress),
                "Factory" => Some(Factory),
                "Freight Equalization Point" => Some(FreightEqualizationPoint),
                "Foreign Freight Forwarder Location" => {
                    Some(ForeignFreightForwarderLocation)
                }
                "Federal Information Processing Standards (FIPS) 55 (Named Populated Places)" => {
                    Some(CodeFI)
                }
                "U.S. Custom's Facilities Information and Resource Management Systems (FIRMS)" => {
                    Some(CodeFR)
                }
                "Freight Station Accounting Code" => Some(FreightStationAccountingCode),
                "Foreign Trade Zone" => Some(ForeignTradeZone),
                "Free Alongside Vessel (Free On Board [F.O.B.] Point)" => Some(CodeFV),
                "Census Block Group" => Some(CensusBlockGroup),
                "Freight Station Geographic Location" => {
                    Some(FreightStationGeographicLocation)
                }
                "Home Address" => Some(HomeAddress),
                "Home Base Address" => Some(HomeBaseAddress),
                "International Air Transport Association (IATA) Location Qualifier" => {
                    Some(CodeIA)
                }
                "Issue Location" => Some(IssueLocation),
                "Military Standard Movement Procedures (MILSTAMP)" => Some(CodeIM),
                "Postal" => Some(Postal),
                "In Store" => Some(InStore),
                "Intermediate FOB Point" => Some(IntermediateFobPoint),
                "Census Tract" => Some(CensusTract),
                "Census Schedule K" => Some(CensusScheduleK),
                "Port of Embarkation" => Some(PortOfEmbarkation),
                "Port of Loading" => Some(PortOfLoading),
                "Government Furnished Property FOB Point" => {
                    Some(GovernmentFurnishedPropertyFobPoint)
                }
                "Local Address" => Some(LocalAddress),
                "Local Office" => Some(LocalOffice),
                "Mailing Address" => Some(MailingAddress),
                "Mill" => Some(Mill),
                "Main Campus" => Some(MainCampus),
                "Metropolitan Sampling Area (MSA) Region Code" => Some(CodeMS),
                "Mexican Postal Code" => Some(MexicanPostalCode),
                "City/State from Points" => Some(CityStateFromPoints),
                "Office Address" => Some(OfficeAddress),
                "Origin (After Loading on Equipment)" => Some(CodeOA),
                "Other Unlisted Free On Board (FOB) Point" => Some(CodeOF),
                "Open and Prepay Station List Code(SCAC & Number)" => Some(CodeOL),
                "Other Unlisted Acceptance Point" => Some(OtherUnlistedAcceptancePoint),
                "Origin (Shipping Point)" => Some(CodeOR),
                "On Vessel (Free On Board [FOB] point)" => Some(CodeOV),
                "Permanent Address" => Some(PermanentAddress),
                "Port of Arrival" => Some(PortOfArrival),
                "Port of Discharge" => Some(PortOfDischarge),
                "Policy Mailing Address" => Some(PolicyMailingAddress),
                "Place of Delivery" => Some(PlaceOfDelivery),
                "Port of Entry" => Some(PortOfEntry),
                "Parents Address" => Some(ParentsAddress),
                "Primary" => Some(Primary),
                "Prior Business" => Some(PriorBusiness),
                "Plant" => Some(Plant),
                "Primary Metropolitan Statistical Area (PMSA)" => Some(CodePM),
                "Principal Servicing Office" => Some(PrincipalServicingOffice),
                "Pool Point" => Some(PoolPoint),
                "3 Digit U.S. ZIP" => Some(CodePQ),
                "4 Digit U.S. ZIP" => Some(CodePR),
                "5 Digit U.S. ZIP" => Some(CodePS),
                "3 Digit Canadian Postal Code" => Some(CodePT),
                "6 Digit Canadian Postal Code" => Some(CodePU),
                "9 DIGIT U.S. ZIP" => Some(CodePV),
                "11 DIGIT U.S. ZIP" => Some(CodePZ),
                "Birthplace" => Some(Birthplace),
                "Rate Area Code" => Some(RateAreaCode),
                "In Rail Car" => Some(InRailCar),
                "Regional Education Service Agency" => {
                    Some(RegionalEducationServiceAgency)
                }
                "Region Code" => Some(RegionCode),
                "Region" => Some(Region),
                "Rural" => Some(Rural),
                "Standard Carrier Alpha Code" => Some(StandardCarrierAlphaCode),
                "Route Administrative Message To" => Some(RouteAdministrativeMessageTo),
                "Secondary" => Some(Secondary),
                "Suburban" => Some(Suburban),
                "City/State and Points Within" => Some(CityStateAndPointsWithin),
                "School District" => Some(SchoolDistrict),
                "Summer" => Some(Summer),
                "Storage" => Some(Storage),
                "School Campus Code" => Some(SchoolCampusCode),
                "U.S. SPLC" => Some(USSplc),
                "Store Number" => Some(StoreNumber),
                "State/Province" => Some(StateProvince),
                "School" => Some(School),
                "In Storage Tank" => Some(InStorageTank),
                "Switching District" => Some(SwitchingDistrict),
                "Tank" => Some(Tank),
                "Transcontinental Freight Bureau" => Some(TranscontinentalFreightBureau),
                "Tribal Land" => Some(TribalLand),
                "Terminal Cargo Location" => Some(TerminalCargoLocation),
                "Terminal" => Some(Terminal),
                "Township" => Some(Township),
                "Temporary" => Some(Temporary),
                "Rail Territory" => Some(RailTerritory),
                "Taxing District" => Some(TaxingDistrict),
                "United Nations Location Code (UNLOCODE)" => Some(CodeUN),
                "Urban" => Some(Urban),
                "Business Unit" => Some(BusinessUnit),
                "Vacation" => Some(Vacation),
                "Village" => Some(Village),
                "Vessel Stowage Location" => Some(VesselStowageLocation),
                "Worldwide Geographic Location Code" => {
                    Some(WorldwideGeographicLocationCode)
                }
                "Wharf" => Some(Wharf),
                "Warehouse" => Some(Warehouse),
                "Winter" => Some(Winter),
                "National Center for Education Statistics Locale Code" => {
                    Some(NationalCenterForEducationStatisticsLocaleCode)
                }
                "Zone Code" => Some(ZoneCode),
                "Mutually Defined" => Some(MutuallyDefined),
                _ => None,
            }
        }
    }
}
impl Serialize for LocationQualifier {
    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 = LocationQualifier;
    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        formatter.write_str("Location Qualifier")
    }
    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
    where
        E: de::Error,
    {
        LocationQualifier::from_description(v)
            .ok_or_else(|| E::custom(format!("Invalid Location Qualifier: {}", v)))
    }
    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
    where
        E: de::Error,
    {
        LocationQualifier::from_code(v)
            .ok_or_else(|| E::custom(
                format!(
                    "Invalid Location Qualifier: {}", std::str::from_utf8(v).unwrap()
                ),
            ))
    }
}
impl<'de> Deserialize<'de> for LocationQualifier {
    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)
        }
    }
}