pax_global_header 0000666 0000000 0000000 00000000064 11441756261 0014521 g ustar 00root root 0000000 0000000 52 comment=3199dbb7dea862a68cf42df667c29e905cb2f1bd
atz-Business-EDI-327e01f/ 0000775 0000000 0000000 00000000000 11441756261 0015040 5 ustar 00root root 0000000 0000000 atz-Business-EDI-327e01f/Changes 0000664 0000000 0000000 00000002345 11441756261 0016337 0 ustar 00root root 0000000 0000000 Revision history for Business-EDI
0.05 2010-09-08
Bump Test::More version requirement. This fixes clean installs on,
for example, Ubuntu Lucid, where v0.92 doesn't have subtest.
0.04 2010-08-27
HTML output added (html method).
Composite "value" removed (they have subparts, not a value).
0.03 2010-08-04
Metamap segment groups for ORDERS, complete with spec range syntax and
sort function for spec designations.
xpath accessor, like $ordrsp->xpath("SG27/LIN/1229").
xpath accessor, w/ metamap like $ordrsp->xpath("line_details/LIN/1229").
Segment_group package.
Message package.
Many tests.
Some POD documentation.
0.02 2010-05-21
CSV spec files now govern Segment and Composite creation, parsing.
Business::EDI::Spec class handles location and parsing of spec CSV files.
Business::EDI::Segment::RFF and Business::EDI::Segment::BGM deprecated.
Additional tests added.
Deeploading (AUTOLOAD through subelements), i.e. collapsible Composites.
Data normalization on segment and message constructors.
0.01 2010-04-14
Rudimentary first version, mainly for incoming ORDRSP data.
atz-Business-EDI-327e01f/LICENSE 0000664 0000000 0000000 00000050101 11441756261 0016042 0 ustar 00root root 0000000 0000000 Terms of Perl itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
---------------------------------------------------------------------------
The General Public License (GPL)
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to most of
the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software is
covered by the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you wish), that
you receive source code or can get it if you want it, that you can change the
software or use pieces of it in new free programs; and that you know you can do
these things.
To protect your rights, we need to make restrictions that forbid anyone to deny
you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a
fee, you must give the recipients all the rights that you have. You must make
sure that they, too, receive or can get the source code. And you must show
them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer
you this license which gives you legal permission to copy, distribute and/or
modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If the
software is modified by someone else and passed on, we want its recipients to
know that what they have is not the original, so that any problems introduced by
others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish
to avoid the danger that redistributors of a free program will individually obtain
patent licenses, in effect making the program proprietary. To prevent this, we
have made it clear that any patent must be licensed for everyone's free use or
not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms of
this General Public License. The "Program", below, refers to any such program
or work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or translated
into another language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by
this License; they are outside its scope. The act of running the Program is not
restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made by
running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as
you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence of any
warranty; and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at
your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus
forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you also
meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you
changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in
part contains or is derived from the Program or any part thereof, to be licensed
as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you
must cause it, when started running for such interactive use in the most ordinary
way, to print or display an announcement including an appropriate copyright
notice and a notice that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these conditions,
and telling the user how to view a copy of this License. (Exception: if the
Program itself is interactive but does not normally print such an announcement,
your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be on
the terms of this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the right to control
the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the
Program (or with a work based on the Program) on a volume of a storage or
distribution medium does not bring the other work under the scope of this
License.
3. You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1 and 2
above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any
third party, for a charge no more than your cost of physically performing source
distribution, a complete machine-readable copy of the corresponding source
code, to be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus any associated interface definition
files, plus the scripts used to control compilation and installation of the
executable. However, as a special exception, the source code distributed need
not include anything that is normally distributed (in either source or binary form)
with the major components (compiler, kernel, and so on) of the operating system
on which the executable runs, unless that component itself accompanies the
executable.
If distribution of executable or object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source
code from the same place counts as distribution of the source code, even though
third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so long
as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the Program
or its derivative works. These actions are prohibited by law if you do not accept
this License. Therefore, by modifying or distributing the Program (or any work
based on the Program), you indicate your acceptance of this License to do so,
and all its terms and conditions for copying, distributing or modifying the
Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor to copy,
distribute or modify the Program subject to these terms and conditions. You
may not impose any further restrictions on the recipients' exercise of the rights
granted herein. You are not responsible for enforcing compliance by third parties
to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed on
you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of this
License. If you cannot distribute so as to satisfy simultaneously your obligations
under this License and any other pertinent obligations, then as a consequence
you may not distribute the Program at all. For example, if a patent license would
not permit royalty-free redistribution of the Program by all those who receive
copies directly or indirectly through you, then the only way you could satisfy
both it and this License would be to refrain entirely from distribution of the
Program.
If any portion of this section is held invalid or unenforceable under any particular
circumstance, the balance of the section is intended to apply and the section as
a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other
property right claims or to contest validity of any such claims; this section has
the sole purpose of protecting the integrity of the free software distribution
system, which is implemented by public license practices. Many people have
made generous contributions to the wide range of software distributed through
that system in reliance on consistent application of that system; it is up to the
author/donor to decide if he or she is willing to distribute software through any
other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries
either by patents or by copyrighted interfaces, the original copyright holder who
places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is permitted
only in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the
General Public License from time to time. Such new versions will be similar in
spirit to the present version, but may differ in detail to address new problems or
concerns.
Each version is given a distinguishing version number. If the Program specifies a
version number of this License which applies to it and "any later version", you
have the option of following the terms and conditions either of that version or of
any later version published by the Free Software Foundation. If the Program does
not specify a version number of this License, you may choose any version ever
published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status of all
derivatives of our free software and of promoting the sharing and reuse of
software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS
NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
---------------------------------------------------------------------------
The Artistic License
Preamble
The intent of this document is to state the conditions under which a Package
may be copied, such that the Copyright Holder maintains some semblance of
artistic control over the development of the package, while giving the users of the
package the right to use and distribute the Package in a more-or-less customary
fashion, plus the right to make reasonable modifications.
Definitions:
- "Package" refers to the collection of files distributed by the Copyright
Holder, and derivatives of that collection of files created through textual
modification.
- "Standard Version" refers to such a Package if it has not been modified,
or has been modified in accordance with the wishes of the Copyright
Holder.
- "Copyright Holder" is whoever is named in the copyright or copyrights for
the package.
- "You" is you, if you're thinking about copying or distributing this Package.
- "Reasonable copying fee" is whatever you can justify on the basis of
media cost, duplication charges, time of people involved, and so on. (You
will not be required to justify it to the Copyright Holder, but only to the
computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you duplicate
all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived from
the Public Domain or from the Copyright Holder. A Package modified in such a
way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and when
you changed that file, and provided that you do at least ONE of the following:
a) place your modifications in the Public Domain or otherwise
make them Freely Available, such as by posting said modifications
to Usenet or an equivalent medium, or placing the modifications on
a major archive site such as ftp.uu.net, or by allowing the
Copyright Holder to include your modifications in the Standard
Version of the Package.
b) use the modified Package only within your corporation or
organization.
c) rename any non-standard executables so the names do not
conflict with standard executables, which must also be provided,
and provide a separate manual page for each non-standard
executable that clearly documents how it differs from the Standard
Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library
files, together with instructions (in the manual page or equivalent)
on where to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) accompany any non-standard executables with their
corresponding Standard Version executables, giving the
non-standard executables non-standard names, and clearly
documenting the differences in manual pages (or equivalent),
together with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this Package.
You may charge any fee you choose for support of this Package. You may not
charge a fee for this Package itself. However, you may distribute this Package in
aggregate with other (possibly commercial) programs as part of a larger
(possibly commercial) software distribution provided that you do not advertise
this Package as a product of your own.
6. The scripts and library files supplied as input to or produced as output from
the programs of this Package do not automatically fall under the copyright of this
Package, but belong to whomever generated them, and may be sold
commercially, and may be aggregated with this Package.
7. C or perl subroutines supplied by you and linked into this Package shall not
be considered part of this Package.
8. Aggregation of this Package with a commercial distribution is always permitted
provided that the use of this Package is embedded; that is, when no overt attempt
is made to make this Package's interfaces visible to the end user of the
commercial distribution. Such use shall not be construed as a distribution of
this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
The End
atz-Business-EDI-327e01f/MANIFEST 0000664 0000000 0000000 00000104520 11441756261 0016173 0 ustar 00root root 0000000 0000000 Changes
MANIFEST
Makefile.PL
README
Todo
lib/Business/EDI/CodeList/AccountingEntryTypeNameCode.pm
lib/Business/EDI/CodeList/AccountTypeCodeQualifier.pm
lib/Business/EDI/CodeList/AcknowledgementRequest.pm
lib/Business/EDI/CodeList/ActionCoded.pm
lib/Business/EDI/CodeList/ActionCode.pm
lib/Business/EDI/CodeList/AddressFormatCode.pm
lib/Business/EDI/CodeList/AddressPurposeCode.pm
lib/Business/EDI/CodeList/AddressStatusCode.pm
lib/Business/EDI/CodeList/AddressTypeCode.pm
lib/Business/EDI/CodeList/AdjustmentReasonDescriptionCode.pm
lib/Business/EDI/CodeList/AgreementTypeCodeQualifier.pm
lib/Business/EDI/CodeList/AgreementTypeDescriptionCode.pm
lib/Business/EDI/CodeList/AlgorithmCoded.pm
lib/Business/EDI/CodeList/AlgorithmCodeListIdentifier.pm
lib/Business/EDI/CodeList/AlgorithmParameterQualifier.pm
lib/Business/EDI/CodeList/AlgorithmParameterValue.pm
lib/Business/EDI/CodeList/AllowanceOrChargeCodeQualifier.pm
lib/Business/EDI/CodeList/AllowanceOrChargeIdentificationCode.pm
lib/Business/EDI/CodeList/AnticollisionSegmentGroupIdentification.pm
lib/Business/EDI/CodeList/ApplicabilityCodeQualifier.pm
lib/Business/EDI/CodeList/ApplicationPassword.pm
lib/Business/EDI/CodeList/ApplicationRecipientIdentification.pm
lib/Business/EDI/CodeList/ApplicationReference.pm
lib/Business/EDI/CodeList/ApplicationSenderIdentification.pm
lib/Business/EDI/CodeList/AssociationAssignedCode.pm
lib/Business/EDI/CodeList/AttendanceTypeCodeQualifier.pm
lib/Business/EDI/CodeList/AttendeeCategoryDescriptionCode.pm
lib/Business/EDI/CodeList/AttributeFunctionCodeQualifier.pm
lib/Business/EDI/CodeList/BackOrderArrangementTypeCode.pm
lib/Business/EDI/CodeList/BankOperationCode.pm
lib/Business/EDI/CodeList/BasisCodeQualifier.pm
lib/Business/EDI/CodeList/BusinessFunctionCode.pm
lib/Business/EDI/CodeList/BusinessFunctionTypeCodeQualifier.pm
lib/Business/EDI/CodeList/CalculationSequenceCode.pm
lib/Business/EDI/CodeList/CargoTypeClassificationCode.pm
lib/Business/EDI/CodeList/CertaintyDescriptionCode.pm
lib/Business/EDI/CodeList/CertificateOriginalCharacterSetRepertoireCoded.pm
lib/Business/EDI/CodeList/CertificateReference.pm
lib/Business/EDI/CodeList/CertificateSequenceNumber.pm
lib/Business/EDI/CodeList/CertificateSyntaxAndVersionCoded.pm
lib/Business/EDI/CodeList/ChangeReasonDescriptionCode.pm
lib/Business/EDI/CodeList/CharacterEncodingCoded.pm
lib/Business/EDI/CodeList/CharacteristicRelevanceCode.pm
lib/Business/EDI/CodeList/CharacteristicValueDescriptionCode.pm
lib/Business/EDI/CodeList/ChargeCategoryCode.pm
lib/Business/EDI/CodeList/ChargePeriodTypeCode.pm
lib/Business/EDI/CodeList/ChargeUnitCode.pm
lib/Business/EDI/CodeList/ClassTypeCode.pm
lib/Business/EDI/CodeList/ClauseCodeQualifier.pm
lib/Business/EDI/CodeList/ClinicalInformationTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ClinicalInterventionDescriptionCode.pm
lib/Business/EDI/CodeList/ClinicalInterventionTypeCodeQualifier.pm
lib/Business/EDI/CodeList/CodeListDirectoryVersionNumber.pm
lib/Business/EDI/CodeList/CodeListResponsibleAgencyCode.pm
lib/Business/EDI/CodeList/CodeSetIndicatorCode.pm
lib/Business/EDI/CodeList/CodeValueSourceCode.pm
lib/Business/EDI/CodeList/CommonAccessReference.pm
lib/Business/EDI/CodeList/CommunicationMeansTypeCode.pm
lib/Business/EDI/CodeList/CommunicationMediumTypeCode.pm
lib/Business/EDI/CodeList/ComputerEnvironmentDetailsCodeQualifier.pm
lib/Business/EDI/CodeList/ConfigurationOperationCode.pm
lib/Business/EDI/CodeList/ContactFunctionCode.pm
lib/Business/EDI/CodeList/ContractAndCarriageConditionCode.pm
lib/Business/EDI/CodeList/ContributionCodeQualifier.pm
lib/Business/EDI/CodeList/ContributionTypeDescriptionCode.pm
lib/Business/EDI/CodeList/ControllingAgencyCoded.pm
lib/Business/EDI/CodeList/ControlTotalTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ConveyanceCallPurposeDescriptionCode.pm
lib/Business/EDI/CodeList/CreditCoverRequestTypeCode.pm
lib/Business/EDI/CodeList/CreditCoverResponseReasonCode.pm
lib/Business/EDI/CodeList/CreditCoverResponseTypeCode.pm
lib/Business/EDI/CodeList/CryptographicModeOfOperationCoded.pm
lib/Business/EDI/CodeList/CurrencyTypeCodeQualifier.pm
lib/Business/EDI/CodeList/CurrencyUsageCodeQualifier.pm
lib/Business/EDI/CodeList/DamageDetailsCodeQualifier.pm
lib/Business/EDI/CodeList/DangerousGoodsRegulationsCode.pm
lib/Business/EDI/CodeList/DataElementUsageTypeCode.pm
lib/Business/EDI/CodeList/DataFormatDescriptionCode.pm
lib/Business/EDI/CodeList/DataRepresentationTypeCode.pm
lib/Business/EDI/CodeList/DateAndTimeQualifier.pm
lib/Business/EDI/CodeList/DateOrTimeOrPeriodFormatCode.pm
lib/Business/EDI/CodeList/DateOrTimeOrPeriodFunctionCodeQualifier.pm
lib/Business/EDI/CodeList/Date.pm
lib/Business/EDI/CodeList/DefinitionExtentCode.pm
lib/Business/EDI/CodeList/DefinitionFunctionCode.pm
lib/Business/EDI/CodeList/DeliveryInstructionCode.pm
lib/Business/EDI/CodeList/DeliveryOrTransportTermsDescriptionCode.pm
lib/Business/EDI/CodeList/DeliveryOrTransportTermsFunctionCode.pm
lib/Business/EDI/CodeList/DeliveryPlanCommitmentLevelCode.pm
lib/Business/EDI/CodeList/DescriptionFormatCode.pm
lib/Business/EDI/CodeList/DesignatedClassCode.pm
lib/Business/EDI/CodeList/DespatchPatternCode.pm
lib/Business/EDI/CodeList/DespatchPatternTimingCode.pm
lib/Business/EDI/CodeList/DiagnosisTypeCode.pm
lib/Business/EDI/CodeList/DialogueIdentification.pm
lib/Business/EDI/CodeList/DialogueReleaseNumber.pm
lib/Business/EDI/CodeList/DialogueVersionNumber.pm
lib/Business/EDI/CodeList/DimensionTypeCodeQualifier.pm
lib/Business/EDI/CodeList/DischargeTypeDescriptionCode.pm
lib/Business/EDI/CodeList/DiscrepancyNatureIdentificationCode.pm
lib/Business/EDI/CodeList/DocumentLineActionCode.pm
lib/Business/EDI/CodeList/DocumentNameCode.pm
lib/Business/EDI/CodeList/DocumentStatusCode.pm
lib/Business/EDI/CodeList/DosageAdministrationCodeQualifier.pm
lib/Business/EDI/CodeList/DuplicateIndicator.pm
lib/Business/EDI/CodeList/DutyOrTaxOrFeeCategoryCode.pm
lib/Business/EDI/CodeList/DutyOrTaxOrFeeFunctionCodeQualifier.pm
lib/Business/EDI/CodeList/DutyOrTaxOrFeeRateBasisCode.pm
lib/Business/EDI/CodeList/DutyOrTaxOrFeeTypeNameCode.pm
lib/Business/EDI/CodeList/DutyRegimeTypeCode.pm
lib/Business/EDI/CodeList/EditMaskRepresentationCode.pm
lib/Business/EDI/CodeList/EmploymentDetailsCodeQualifier.pm
lib/Business/EDI/CodeList/EnactingPartyIdentifier.pm
lib/Business/EDI/CodeList/EncryptionReferenceNumber.pm
lib/Business/EDI/CodeList/EquipmentSizeAndTypeDescriptionCode.pm
lib/Business/EDI/CodeList/EquipmentStatusCode.pm
lib/Business/EDI/CodeList/EquipmentSupplierCode.pm
lib/Business/EDI/CodeList/EquipmentTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ErroneousComponentDataElementPosition.pm
lib/Business/EDI/CodeList/ErroneousDataElementOccurrence.pm
lib/Business/EDI/CodeList/ErroneousDataElementPositionInSegment.pm
lib/Business/EDI/CodeList/EventDate.pm
lib/Business/EDI/CodeList/EventDetailsCodeQualifier.pm
lib/Business/EDI/CodeList/EventTime.pm
lib/Business/EDI/CodeList/EventTimeReferenceCode.pm
lib/Business/EDI/CodeList/ExcessTransportationReasonCode.pm
lib/Business/EDI/CodeList/ExcessTransportationResponsibilityCode.pm
lib/Business/EDI/CodeList/ExchangeRateCurrencyMarketIdentifier.pm
lib/Business/EDI/CodeList/FacilityTypeDescriptionCode.pm
lib/Business/EDI/CodeList/FilterFunctionCoded.pm
lib/Business/EDI/CodeList/FinancialTransactionTypeCode.pm
lib/Business/EDI/CodeList/FirstAndLastTransfer.pm
lib/Business/EDI/CodeList/FormulaSequenceCodeQualifier.pm
lib/Business/EDI/CodeList/FormulaSequenceOperandCode.pm
lib/Business/EDI/CodeList/FormulaTypeCodeQualifier.pm
lib/Business/EDI/CodeList/FreeTextFormatCode.pm
lib/Business/EDI/CodeList/FreeTextFunctionCode.pm
lib/Business/EDI/CodeList/FrequencyCode.pm
lib/Business/EDI/CodeList/FrequencyCodeQualifier.pm
lib/Business/EDI/CodeList/FullOrEmptyIndicatorCode.pm
lib/Business/EDI/CodeList/GeographicalPositionCodeQualifier.pm
lib/Business/EDI/CodeList/GeographicAreaCode.pm
lib/Business/EDI/CodeList/GovernmentActionCode.pm
lib/Business/EDI/CodeList/GovernmentAgencyIdentificationCode.pm
lib/Business/EDI/CodeList/GovernmentInvolvementCode.pm
lib/Business/EDI/CodeList/GovernmentProcedureCode.pm
lib/Business/EDI/CodeList/GroupControlCount.pm
lib/Business/EDI/CodeList/GroupReferenceNumber.pm
lib/Business/EDI/CodeList/HandlingInstructionDescriptionCode.pm
lib/Business/EDI/CodeList/HaulageArrangementsCode.pm
lib/Business/EDI/CodeList/HierarchicalStructureRelationshipCode.pm
lib/Business/EDI/CodeList/HierarchyObjectCodeQualifier.pm
lib/Business/EDI/CodeList/IdentificationCodeQualifier.pm
lib/Business/EDI/CodeList/IndexCodeQualifier.pm
lib/Business/EDI/CodeList/IndexingStructureCodeQualifier.pm
lib/Business/EDI/CodeList/IndexRepresentationCode.pm
lib/Business/EDI/CodeList/IndexTypeIdentifier.pm
lib/Business/EDI/CodeList/InformationCategoryCode.pm
lib/Business/EDI/CodeList/InformationDetailsCodeQualifier.pm
lib/Business/EDI/CodeList/InitiatorControlReference.pm
lib/Business/EDI/CodeList/InitiatorReferenceIdentification.pm
lib/Business/EDI/CodeList/InstructionDescriptionCode.pm
lib/Business/EDI/CodeList/InstructionReceivingPartyIdentifier.pm
lib/Business/EDI/CodeList/InstructionTypeCodeQualifier.pm
lib/Business/EDI/CodeList/InteractiveMessageReferenceNumber.pm
lib/Business/EDI/CodeList/InterchangeAgreementIdentifier.pm
lib/Business/EDI/CodeList/InterchangeControlCount.pm
lib/Business/EDI/CodeList/InterchangeControlReference.pm
lib/Business/EDI/CodeList/InterchangeRecipientIdentification.pm
lib/Business/EDI/CodeList/InterchangeRecipientInternalIdentification.pm
lib/Business/EDI/CodeList/InterchangeRecipientInternalSubidentification.pm
lib/Business/EDI/CodeList/InterchangeSenderIdentification.pm
lib/Business/EDI/CodeList/InterchangeSenderInternalIdentification.pm
lib/Business/EDI/CodeList/InterchangeSenderInternalSubidentification.pm
lib/Business/EDI/CodeList/IntracompanyPaymentIndicatorCode.pm
lib/Business/EDI/CodeList/InventoryBalanceMethodCode.pm
lib/Business/EDI/CodeList/InventoryMovementDirectionCode.pm
lib/Business/EDI/CodeList/InventoryMovementReasonCode.pm
lib/Business/EDI/CodeList/InventoryTypeCode.pm
lib/Business/EDI/CodeList/ItemAvailabilityCode.pm
lib/Business/EDI/CodeList/ItemCharacteristicCode.pm
lib/Business/EDI/CodeList/ItemDescriptionCode.pm
lib/Business/EDI/CodeList/ItemTypeIdentificationCode.pm
lib/Business/EDI/CodeList/KeyManagementFunctionQualifier.pm
lib/Business/EDI/CodeList/KeyName.pm
lib/Business/EDI/CodeList/LanguageCoded.pm
lib/Business/EDI/CodeList/LanguageCodeQualifier.pm
lib/Business/EDI/CodeList/LengthOfDataInOctetsOfBits.pm
lib/Business/EDI/CodeList/LengthOfObjectInOctetsOfBits.pm
lib/Business/EDI/CodeList/LengthTypeCode.pm
lib/Business/EDI/CodeList/ListParameter.pm
lib/Business/EDI/CodeList/ListParameterQualifier.pm
lib/Business/EDI/CodeList/LocationFunctionCodeQualifier.pm
lib/Business/EDI/CodeList/MaintenanceOperationCode.pm
lib/Business/EDI/CodeList/MaritalStatusDescriptionCode.pm
lib/Business/EDI/CodeList/MarkingInstructionsCode.pm
lib/Business/EDI/CodeList/MarkingTypeCode.pm
lib/Business/EDI/CodeList/MeasuredAttributeCode.pm
lib/Business/EDI/CodeList/MeasurementPurposeCodeQualifier.pm
lib/Business/EDI/CodeList/MeasurementSignificanceCode.pm
lib/Business/EDI/CodeList/MembershipCategoryDescriptionCode.pm
lib/Business/EDI/CodeList/MembershipLevelCodeQualifier.pm
lib/Business/EDI/CodeList/MembershipTypeCodeQualifier.pm
lib/Business/EDI/CodeList/MessageFunctionCode.pm
lib/Business/EDI/CodeList/MessageGroupIdentification.pm
lib/Business/EDI/CodeList/MessageImplementationGuidelineIdentification.pm
lib/Business/EDI/CodeList/MessageImplementationGuidelineReleaseNumber.pm
lib/Business/EDI/CodeList/MessageImplementationGuidelineVersionNumber.pm
lib/Business/EDI/CodeList/MessageReferenceNumber.pm
lib/Business/EDI/CodeList/MessageRelationCoded.pm
lib/Business/EDI/CodeList/MessageReleaseNumber.pm
lib/Business/EDI/CodeList/MessageSectionCode.pm
lib/Business/EDI/CodeList/MessageSubsetIdentification.pm
lib/Business/EDI/CodeList/MessageSubsetReleaseNumber.pm
lib/Business/EDI/CodeList/MessageSubsetVersionNumber.pm
lib/Business/EDI/CodeList/MessageType.pm
lib/Business/EDI/CodeList/MessageTypeSubfunctionIdentification.pm
lib/Business/EDI/CodeList/MessageVersionNumber.pm
lib/Business/EDI/CodeList/ModeOfOperationCodeListIdentifier.pm
lib/Business/EDI/CodeList/MonetaryAmountFunctionDescriptionCode.pm
lib/Business/EDI/CodeList/MonetaryAmountTypeCodeQualifier.pm
lib/Business/EDI/CodeList/MovementTypeDescriptionCode.pm
lib/Business/EDI/CodeList/NameComponentTypeCodeQualifier.pm
lib/Business/EDI/CodeList/NameComponentUsageCode.pm
lib/Business/EDI/CodeList/NameOriginalAlphabetCode.pm
lib/Business/EDI/CodeList/NameStatusCode.pm
lib/Business/EDI/CodeList/NameTypeCode.pm
lib/Business/EDI/CodeList/NationalityCodeQualifier.pm
lib/Business/EDI/CodeList/NondiscreteMeasurementNameCode.pm
lib/Business/EDI/CodeList/NumberOfPaddingBytes.pm
lib/Business/EDI/CodeList/NumberOfSecuritySegments.pm
lib/Business/EDI/CodeList/NumberOfSegmentsBeforeObject.pm
lib/Business/EDI/CodeList/NumberOfSegmentsInAMessage.pm
lib/Business/EDI/CodeList/ObjectIdentificationCodeQualifier.pm
lib/Business/EDI/CodeList/ObjectTypeAttributeIdentification.pm
lib/Business/EDI/CodeList/ObjectTypeAttribute.pm
lib/Business/EDI/CodeList/ObjectTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ObjectTypeQualifier.pm
lib/Business/EDI/CodeList/OrganisationalClassNameCode.pm
lib/Business/EDI/CodeList/OrganisationClassificationCode.pm
lib/Business/EDI/CodeList/OriginalCharacterSetEncodingCoded.pm
lib/Business/EDI/CodeList/OriginatorTypeCode.pm
lib/Business/EDI/CodeList/PackageReferenceNumber.pm
lib/Business/EDI/CodeList/PackagingDangerLevelCode.pm
lib/Business/EDI/CodeList/PackagingLevelCode.pm
lib/Business/EDI/CodeList/PackagingRelatedDescriptionCode.pm
lib/Business/EDI/CodeList/PackagingTermsAndConditionsCode.pm
lib/Business/EDI/CodeList/PaddingMechanismCoded.pm
lib/Business/EDI/CodeList/PaddingMechanismCodeListIdentifier.pm
lib/Business/EDI/CodeList/PartyFunctionCodeQualifier.pm
lib/Business/EDI/CodeList/PartyNameFormatCode.pm
lib/Business/EDI/CodeList/PayerResponsibilityLevelCode.pm
lib/Business/EDI/CodeList/PaymentArrangementCode.pm
lib/Business/EDI/CodeList/PaymentChannelCode.pm
lib/Business/EDI/CodeList/PaymentConditionsCode.pm
lib/Business/EDI/CodeList/PaymentGuaranteeMeansCode.pm
lib/Business/EDI/CodeList/PaymentMeansCode.pm
lib/Business/EDI/CodeList/PaymentTermsDescriptionIdentifier.pm
lib/Business/EDI/CodeList/PaymentTermsTypeCodeQualifier.pm
lib/Business/EDI/CodeList/PercentageBasisIdentificationCode.pm
lib/Business/EDI/CodeList/PercentageTypeCodeQualifier.pm
lib/Business/EDI/CodeList/PeriodTypeCode.pm
lib/Business/EDI/CodeList/PeriodTypeCodeQualifier.pm
lib/Business/EDI/CodeList/PersonCharacteristicCodeQualifier.pm
lib/Business/EDI/CodeList/PhysicalOrLogicalStateDescriptionCode.pm
lib/Business/EDI/CodeList/PhysicalOrLogicalStateTypeCodeQualifier.pm
lib/Business/EDI/CodeList.pm
lib/Business/EDI/CodeList/PriceCodeQualifier.pm
lib/Business/EDI/CodeList/PriceMultiplierTypeCodeQualifier.pm
lib/Business/EDI/CodeList/PriceSpecificationCode.pm
lib/Business/EDI/CodeList/PriceTypeCode.pm
lib/Business/EDI/CodeList/PriorityDescriptionCode.pm
lib/Business/EDI/CodeList/PriorityTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ProcessingIndicatorDescriptionCode.pm
lib/Business/EDI/CodeList/ProcessingInformationCodeQualifier.pm
lib/Business/EDI/CodeList/ProcessingPriorityCode.pm
lib/Business/EDI/CodeList/ProcessStageCodeQualifier.pm
lib/Business/EDI/CodeList/ProcessTypeDescriptionCode.pm
lib/Business/EDI/CodeList/ProductCharacteristicIdentificationCode.pm
lib/Business/EDI/CodeList/ProductDetailsTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ProductGroupTypeCode.pm
lib/Business/EDI/CodeList/ProductIdentifierCodeQualifier.pm
lib/Business/EDI/CodeList/ProvisoCodeQualifier.pm
lib/Business/EDI/CodeList/QualificationApplicationAreaCode.pm
lib/Business/EDI/CodeList/QualificationTypeCodeQualifier.pm
lib/Business/EDI/CodeList/QuantityTypeCodeQualifier.pm
lib/Business/EDI/CodeList/RangeTypeCodeQualifier.pm
lib/Business/EDI/CodeList/RateOrTariffClassDescriptionCode.pm
lib/Business/EDI/CodeList/RatePlanCode.pm
lib/Business/EDI/CodeList/RateTypeCodeQualifier.pm
lib/Business/EDI/CodeList/RecipientReferencepassword.pm
lib/Business/EDI/CodeList/RecipientReferencepasswordQualifier.pm
lib/Business/EDI/CodeList/ReferenceCodeQualifier.pm
lib/Business/EDI/CodeList/ReferenceIdentificationNumber.pm
lib/Business/EDI/CodeList/ReferenceQualifier.pm
lib/Business/EDI/CodeList/RelatedCauseCode.pm
lib/Business/EDI/CodeList/RelationshipDescriptionCode.pm
lib/Business/EDI/CodeList/RelationshipTypeCodeQualifier.pm
lib/Business/EDI/CodeList/RemunerationTypeNameCode.pm
lib/Business/EDI/CodeList/ReportFunctionCoded.pm
lib/Business/EDI/CodeList/ReportReasonCoded.pm
lib/Business/EDI/CodeList/RequestedInformationDescriptionCode.pm
lib/Business/EDI/CodeList/RequirementDesignatorCode.pm
lib/Business/EDI/CodeList/RequirementOrConditionDescriptionIdentifier.pm
lib/Business/EDI/CodeList/ReservationIdentifierCodeQualifier.pm
lib/Business/EDI/CodeList/ResponderControlReference.pm
lib/Business/EDI/CodeList/ResponseTypeCoded.pm
lib/Business/EDI/CodeList/ResponseTypeCode.pm
lib/Business/EDI/CodeList/ResultNormalcyCode.pm
lib/Business/EDI/CodeList/ResultRepresentationCode.pm
lib/Business/EDI/CodeList/ResultValueTypeCodeQualifier.pm
lib/Business/EDI/CodeList/ReturnablePackageFreightPaymentResponsibilityCode.pm
lib/Business/EDI/CodeList/ReturnablePackageLoadContentsCode.pm
lib/Business/EDI/CodeList/RevocationReasonCoded.pm
lib/Business/EDI/CodeList/RoleOfSecurityProviderCoded.pm
lib/Business/EDI/CodeList/SampleDirectionCode.pm
lib/Business/EDI/CodeList/SampleLocationDescriptionCode.pm
lib/Business/EDI/CodeList/SampleProcessStepCode.pm
lib/Business/EDI/CodeList/SampleSelectionMethodCode.pm
lib/Business/EDI/CodeList/SampleStateCode.pm
lib/Business/EDI/CodeList/ScenarioIdentification.pm
lib/Business/EDI/CodeList/ScenarioReleaseNumber.pm
lib/Business/EDI/CodeList/ScenarioVersionNumber.pm
lib/Business/EDI/CodeList/ScopeOfSecurityApplicationCoded.pm
lib/Business/EDI/CodeList/SealConditionCode.pm
lib/Business/EDI/CodeList/SealingPartyNameCode.pm
lib/Business/EDI/CodeList/SealTypeCode.pm
lib/Business/EDI/CodeList/SectionIdentification.pm
lib/Business/EDI/CodeList/SectorAreaIdentificationCodeQualifier.pm
lib/Business/EDI/CodeList/SecurityErrorCoded.pm
lib/Business/EDI/CodeList/SecurityPartyCodeListQualifier.pm
lib/Business/EDI/CodeList/SecurityPartyCodeListResponsibleAgencyCoded.pm
lib/Business/EDI/CodeList/SecurityPartyIdentification.pm
lib/Business/EDI/CodeList/SecurityPartyName.pm
lib/Business/EDI/CodeList/SecurityPartyQualifier.pm
lib/Business/EDI/CodeList/SecurityReferenceNumber.pm
lib/Business/EDI/CodeList/SecuritySegmentPosition.pm
lib/Business/EDI/CodeList/SecuritySequenceNumber.pm
lib/Business/EDI/CodeList/SecurityServiceCoded.pm
lib/Business/EDI/CodeList/SecurityStatusCoded.pm
lib/Business/EDI/CodeList/SegmentPositionInMessageBody.pm
lib/Business/EDI/CodeList/SenderSequenceNumber.pm
lib/Business/EDI/CodeList/SequenceIdentifierSourceCode.pm
lib/Business/EDI/CodeList/SequenceOfTransfers.pm
lib/Business/EDI/CodeList/ServiceBasisCodeQualifier.pm
lib/Business/EDI/CodeList/ServiceCharacterForSignature.pm
lib/Business/EDI/CodeList/ServiceCharacterForSignatureQualifier.pm
lib/Business/EDI/CodeList/ServiceCodeListDirectoryVersionNumber.pm
lib/Business/EDI/CodeList/ServiceRequirementCode.pm
lib/Business/EDI/CodeList/ServiceSegmentTagCoded.pm
lib/Business/EDI/CodeList/ServiceTypeCode.pm
lib/Business/EDI/CodeList/SettlementMeansCode.pm
lib/Business/EDI/CodeList/SetTypeCodeQualifier.pm
lib/Business/EDI/CodeList/SimpleDataElementCharacterRepresentationCode.pm
lib/Business/EDI/CodeList/SizeTypeCodeQualifier.pm
lib/Business/EDI/CodeList/SpecialConditionCode.pm
lib/Business/EDI/CodeList/SpecialServiceDescriptionCode.pm
lib/Business/EDI/CodeList/StatisticTypeCodeQualifier.pm
lib/Business/EDI/CodeList/StatusCategoryCode.pm
lib/Business/EDI/CodeList/StatusCoded.pm
lib/Business/EDI/CodeList/StatusDescriptionCode.pm
lib/Business/EDI/CodeList/Status.pm
lib/Business/EDI/CodeList/StatusReasonDescriptionCode.pm
lib/Business/EDI/CodeList/StructureComponentFunctionCodeQualifier.pm
lib/Business/EDI/CodeList/StructureTypeCode.pm
lib/Business/EDI/CodeList/SublineIndicatorCode.pm
lib/Business/EDI/CodeList/SublineItemPriceChangeOperationCode.pm
lib/Business/EDI/CodeList/SubstitutionConditionCode.pm
lib/Business/EDI/CodeList/SupportingEvidenceTypeCodeQualifier.pm
lib/Business/EDI/CodeList/SurfaceOrLayerCode.pm
lib/Business/EDI/CodeList/SyntaxErrorCoded.pm
lib/Business/EDI/CodeList/SyntaxIdentifier.pm
lib/Business/EDI/CodeList/SyntaxReleaseNumber.pm
lib/Business/EDI/CodeList/SyntaxVersionNumber.pm
lib/Business/EDI/CodeList/TaxOrDutyOrFeePaymentDueDateCode.pm
lib/Business/EDI/CodeList/TemperatureTypeCodeQualifier.pm
lib/Business/EDI/CodeList/TermsTimeRelationCode.pm
lib/Business/EDI/CodeList/TestAdministrationMethodCode.pm
lib/Business/EDI/CodeList/TestIndicator.pm
lib/Business/EDI/CodeList/TestMediumCode.pm
lib/Business/EDI/CodeList/TextSubjectCodeQualifier.pm
lib/Business/EDI/CodeList/TimeOffset.pm
lib/Business/EDI/CodeList/Time.pm
lib/Business/EDI/CodeList/TradeClassCode.pm
lib/Business/EDI/CodeList/TrafficRestrictionCode.pm
lib/Business/EDI/CodeList/TrafficRestrictionTypeCodeQualifier.pm
lib/Business/EDI/CodeList/TransactionControlReference.pm
lib/Business/EDI/CodeList/TransferPositionCoded.pm
lib/Business/EDI/CodeList/TransitDirectionIndicatorCode.pm
lib/Business/EDI/CodeList/TransportChargesPaymentMethodCode.pm
lib/Business/EDI/CodeList/TransportMeansOwnershipIndicatorCode.pm
lib/Business/EDI/CodeList/TransportMovementCode.pm
lib/Business/EDI/CodeList/TransportServicePriorityCode.pm
lib/Business/EDI/CodeList/TransportStageCodeQualifier.pm
lib/Business/EDI/CodeList/UnitTypeCodeQualifier.pm
lib/Business/EDI/CodeList/UseOfAlgorithmCoded.pm
lib/Business/EDI/CodeList/UserAuthorisationLevel.pm
lib/Business/EDI/CodeList/ValidationCriteriaCode.pm
lib/Business/EDI/CodeList/ValidationValue.pm
lib/Business/EDI/CodeList/ValidationValueQualifier.pm
lib/Business/EDI/CodeList/ValueDefinitionCodeQualifier.pm
lib/Business/EDI/CodeList/ValueListTypeCode.pm
lib/Business/EDI/Composite.pm
lib/Business/EDI/data/edifact/iso9735/SDCD.10000.csv
lib/Business/EDI/data/edifact/iso9735/SDCD.20000.csv
lib/Business/EDI/data/edifact/iso9735/SDCD.30000.csv
lib/Business/EDI/data/edifact/iso9735/SDCD.40000.csv
lib/Business/EDI/data/edifact/iso9735/SDCD.40100.csv
lib/Business/EDI/data/edifact/iso9735/SDED.10000.csv
lib/Business/EDI/data/edifact/iso9735/SDED.20000.csv
lib/Business/EDI/data/edifact/iso9735/SDED.30000.csv
lib/Business/EDI/data/edifact/iso9735/SDED.40000.csv
lib/Business/EDI/data/edifact/iso9735/SDED.40100.csv
lib/Business/EDI/data/edifact/iso9735/SDMD.10000.csv
lib/Business/EDI/data/edifact/iso9735/SDMD.20000.csv
lib/Business/EDI/data/edifact/iso9735/SDMD.30000.csv
lib/Business/EDI/data/edifact/iso9735/SDMD.40000.csv
lib/Business/EDI/data/edifact/iso9735/SDMD.40100.csv
lib/Business/EDI/data/edifact/iso9735/SDSD.10000.csv
lib/Business/EDI/data/edifact/iso9735/SDSD.20000.csv
lib/Business/EDI/data/edifact/iso9735/SDSD.30000.csv
lib/Business/EDI/data/edifact/iso9735/SDSD.40000.csv
lib/Business/EDI/data/edifact/iso9735/SDSD.40100.csv
lib/Business/EDI/data/edifact/untdid/EDCD.1901.csv
lib/Business/EDI/data/edifact/untdid/EDCD.1902.csv
lib/Business/EDI/data/edifact/untdid/EDCD.1911.csv
lib/Business/EDI/data/edifact/untdid/EDCD.1921.csv
lib/Business/EDI/data/edifact/untdid/EDCD.2932.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d00a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d00b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d01a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d01b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d01c.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d02a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d02b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d03a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d03b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d04a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d04b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d05a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d05b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d06a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d06b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d07a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d07b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d08a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d93a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d94a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d94b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d95a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d95b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d96a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d96b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d97a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d97b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d98a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d98b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d99a.csv
lib/Business/EDI/data/edifact/untdid/EDCD.d99b.csv
lib/Business/EDI/data/edifact/untdid/EDCD.s93a.csv
lib/Business/EDI/data/edifact/untdid/EDED.1901.csv
lib/Business/EDI/data/edifact/untdid/EDED.1902.csv
lib/Business/EDI/data/edifact/untdid/EDED.1911.csv
lib/Business/EDI/data/edifact/untdid/EDED.1921.csv
lib/Business/EDI/data/edifact/untdid/EDED.2932.csv
lib/Business/EDI/data/edifact/untdid/EDED.d00a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d00b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d01a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d01b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d01c.csv
lib/Business/EDI/data/edifact/untdid/EDED.d02a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d02b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d03a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d03b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d04a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d04b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d05a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d05b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d06a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d06b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d07a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d07b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d08a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d93a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d94a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d94b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d95a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d95b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d96a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d96b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d97a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d97b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d98a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d98b.csv
lib/Business/EDI/data/edifact/untdid/EDED.d99a.csv
lib/Business/EDI/data/edifact/untdid/EDED.d99b.csv
lib/Business/EDI/data/edifact/untdid/EDED.s93a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.1901.csv
lib/Business/EDI/data/edifact/untdid/EDMD.1902.csv
lib/Business/EDI/data/edifact/untdid/EDMD.1911.csv
lib/Business/EDI/data/edifact/untdid/EDMD.1921.csv
lib/Business/EDI/data/edifact/untdid/EDMD.2932.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d00a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d00b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d01a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d01b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d01c.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d02a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d02b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d03a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d03b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d04a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d04b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d05a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d05b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d06a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d06b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d07a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d07b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d08a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d93a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d94a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d94b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d95a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d95b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d96a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d96b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d97a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d97b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d98a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d98b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d99a.csv
lib/Business/EDI/data/edifact/untdid/EDMD.d99b.csv
lib/Business/EDI/data/edifact/untdid/EDMD.s93a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.1901.csv
lib/Business/EDI/data/edifact/untdid/EDSD.1902.csv
lib/Business/EDI/data/edifact/untdid/EDSD.1911.csv
lib/Business/EDI/data/edifact/untdid/EDSD.1921.csv
lib/Business/EDI/data/edifact/untdid/EDSD.2932.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d00a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d00b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d01a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d01b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d01c.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d02a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d02b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d03a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d03b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d04a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d04b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d05a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d05b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d06a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d06b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d07a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d07b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d08a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d93a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d94a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d94b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d95a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d95b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d96a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d96b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d97a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d97b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d98a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d98b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d99a.csv
lib/Business/EDI/data/edifact/untdid/EDSD.d99b.csv
lib/Business/EDI/data/edifact/untdid/EDSD.s93a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d00a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d00b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d01a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d01b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d01c.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d02a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d02b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d03a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d03b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d04a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d04b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d05a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d05b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d06a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d06b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d07a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d07b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d08a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d97a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d97b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d98a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d98b.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d99a.csv
lib/Business/EDI/data/edifact/untdid/IDCD.d99b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d00a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d00b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d01a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d01b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d01c.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d02a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d02b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d03a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d03b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d04a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d04b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d05a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d05b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d06a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d06b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d07a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d07b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d08a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d97a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d97b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d98a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d98b.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d99a.csv
lib/Business/EDI/data/edifact/untdid/IDMD.d99b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d00a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d00b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d01a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d01b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d01c.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d02a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d02b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d03a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d03b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d04a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d04b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d05a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d05b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d06a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d06b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d07a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d07b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d08a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d97a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d97b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d98a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d98b.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d99a.csv
lib/Business/EDI/data/edifact/untdid/IDSD.d99b.csv
lib/Business/EDI/DataElement.pm
lib/Business/EDI/Generator.pm
lib/Business/EDI/Object.pm
lib/Business/EDI.pm
lib/Business/EDI.pm.bak
lib/Business/EDI/Segment/BGM.pm
lib/Business/EDI/Segment.pm
lib/Business/EDI/Segment/RFF_CA.pm
lib/Business/EDI/Segment/RFF.pm
lib/Business/EDI/Spec.pm
lib/Business/EDI/Test.pm
t/000-load.t
t/001-File-Find.t
t/002a-Spec-for-Segment_group.t
t/002-Spec-analysis.t
t/002-Spec.t
t/003-CodeList.t
t/004-Composite.t
t/005-Segment-BGM-1004.t
t/005-Segment-BGM.t
t/005-Segment-from-CSV.t
t/006-Segment-RFF.t
t/020-Message-ORDRSP.t
t/021-Message-ORDRSP-xpath.t
t/022-Message-ORDRSP-all_accessor.t
t/999-data.t
t/edi.t
t/manifest.t
t/pod.t
atz-Business-EDI-327e01f/Makefile.PL 0000664 0000000 0000000 00000001414 11441756261 0017012 0 ustar 00root root 0000000 0000000
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'Business::EDI',
VERSION_FROM => 'lib/Business/EDI.pm', # finds \$VERSION
AUTHOR => 'Joe Atzberger (atz@esilibrary.com)',
ABSTRACT => 'Top level generator of U.N. EDI objects',
PREREQ_PM => {
'CGI' => 3.1,
'Test::More' => 0.94,
'Test::Simple' => 0.88,
'Exporter::Easy' => 0.14,
'List::MoreUtils' => 0.22,
'File::Find::Rule' => 0.32,
'UNIVERSAL::require' => 0.10,
'JSON::XS' => 2.01,
},
);
atz-Business-EDI-327e01f/README 0000664 0000000 0000000 00000002215 11441756261 0015720 0 ustar 00root root 0000000 0000000 Business-EDI
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
You may want to use "sudo make install", if you want it installed globally on
your system.
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the
perldoc command.
perldoc Business::EDI
Development is coordinated via github, where you will find the most recent code:
http://github.com/atz/Business-EDI
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Business-EDI
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Business-EDI
CPAN Ratings
http://cpanratings.perl.org/d/Business-EDI
Search CPAN
http://search.cpan.org/dist/Business-EDI/
LICENSE AND COPYRIGHT
Copyright (C) 2010 Joe Atzberger
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
atz-Business-EDI-327e01f/Todo 0000664 0000000 0000000 00000000513 11441756261 0015667 0 ustar 00root root 0000000 0000000 TODO list for Perl module Business::EDI
- Extend Spec-driven approach to smaller objects: Data Elements, Composites, etc.
- I18n
- Lots of docs
- Spec "Line" package/objects
Long Term:
- input and output of actual EDI files
- a strict/validation mode
- Add X12 codes to messages: http://en.wikipedia.org/wiki/X12_EDIFACT_Mapping
atz-Business-EDI-327e01f/ignore.txt 0000664 0000000 0000000 00000000211 11441756261 0017056 0 ustar 00root root 0000000 0000000 .git
cp_lib.sh
blib*
Makefile
Makefile.old
Build
Build.bat
_build*
pm_to_blib*
*.tar.gz
.lwpcookies
cover_db
pod2htm*.tmp
Business-EDI-*
atz-Business-EDI-327e01f/lib/ 0000775 0000000 0000000 00000000000 11441756261 0015606 5 ustar 00root root 0000000 0000000 atz-Business-EDI-327e01f/lib/Business/ 0000775 0000000 0000000 00000000000 11441756261 0017401 5 ustar 00root root 0000000 0000000 atz-Business-EDI-327e01f/lib/Business/EDI.pm 0000664 0000000 0000000 00000121553 11441756261 0020347 0 ustar 00root root 0000000 0000000 package Business::EDI;
use strict;
use warnings;
use Carp;
# use Data::Dumper;
our $VERSION = 0.05;
use UNIVERSAL::require;
use Data::Dumper;
use File::Spec;
use CGI qw//;
use Business::EDI::CodeList;
use Business::EDI::Composite;
use Business::EDI::DataElement;
use Business::EDI::Segment;
use Business::EDI::Spec;
our $debug = 0;
our %debug = ();
our $error; # for the whole class
my %fields = ();
our $AUTOLOAD;
sub DESTROY {} #
sub AUTOLOAD {
my $self = shift;
my $class = ref($self) or croak "AUTOLOAD error: $self is not an object, looking for $AUTOLOAD";
my $name = $AUTOLOAD;
$name =~ s/.*://; # strip leading package stuff
$name =~ /^syntax/ or # leave syntax,
$name =~ /^SG\d+$/ or # leave SGxx alone (for segment groups)
$name =~ s/^s(eg(ment)?)?//i or # strip segment (a prefix to avoid numerical method names)
$name =~ s/^p(art)?//i; # strip part -- autoload's parallel accessor, e.g. ->part4343 to ->part(4343)
$debug and warn "AUTOLOADING '$name' for " . $class;
if (exists $self->{_permitted}->{$name}) { # explicitly named accessible fields
if (@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
if (ref $self->{def} eq 'ARRAY') { # spec defined subelements
if ($name =~ s/^all_(.+)$/$1/i) {
@_ and croak "AUTOLOAD error: all_$name is read_only, rec'd argument(s): " . join(', ', @_);
if ($debug) {
warn "AUTOLOADing " . $self->{code} . "/all_$name (from " . scalar(@{$self->{array}}) . " arrayed elements): "
. join(' ', map {$_->{code}} @{$self->{array}});
$debug > 1 and print STDERR Dumper($self), "\n";
}
my $target = $name =~ /^SG\d+$/ ? ($self->{code} . "/$name") : $name;
return grep {$_->{code} and $_->{code} eq $target} @{$self->{array}}; # return array
}
return __PACKAGE__->_deepload_array($self, $name, @_); # not $self->_deepload - avoid recursion
}
# lastly, try to reach through any Cxxx Composites, if the target is unique
return __PACKAGE__->_deepload($self, $name, @_); # not $self->_deepload - avoid recursion
}
sub _deepload_array {
my $pkg = shift; # does nothing
my $self = shift or return;
my $name = shift or return;
unless ($self->{def}) {
die "_deepload_array of '$name' attempted on an object that does not have a spec definition";
return;
}
my @hits = grep {$_->{code} eq $name} @{$self->{def}};
my $defcount = scalar @{$self->{def}};
my $hitcount = scalar @hits;
my $total_possible = 0;
foreach (@hits) {
$total_possible += ($_->{repeats} || 1);
}
$name =~ /^SG\d+$/ and $name = $self->{message_code} . "/$name"; # adjust key for SGs
$debug and warn "Looking for '$name' matches $hitcount of $defcount subelements, w/ $total_possible instances: " . join(' ', map {$_->{code}} @hits);
$debug and warn ref($self) . " self->{array} has " . scalar(@{$self->{array}}) . " elements of data";
# Logic:
# If there is only one possible element to match, then we can read/write to it.
# But if there are multiple repetitions possible, then we cannot tell which one to target,
# UNLESS it is a read operation and there is only one such element populated.
# Write operation still would be indifferentiable between new element constructor and existing elememt overwrite.
if ($total_possible == 1 or ($hitcount == 1 and not @_)) {
foreach (@{$self->{array}}) {
$_->code eq $name or next;
if (@_) {
return $_ = shift;
} else {
return $_;
}
}
# if we got here, it's a valid target w/ no populated value (no code match)
return;
# @_ or return $self->_subelement_helper($name, {}, $self->{message_code}); # so you get an empty object of the correct type on read
# TODO: for 1-hit write, splice in at the correct position. Tricky.
} elsif ($total_possible == 0) {
$debug and $debug > 1 and print STDERR "FAILED _deepload_array of '$name' in object: ", Dumper($self);
}
croak "AUTOLOAD error: Cannot " . (@_ ? 'write' : 'read') . " '$name' field of class '" . ref($self)
. "', $hitcount matches ($total_possible repetitions) in subelements";
}
sub _deepload {
my $pkg = shift; # does nothing
my $self = shift or return;
my $name = shift or return;
$self->{_permitted} or return;
my @partkeys = $self->part_keys;
my @keys = grep {/^C\d{3}$/} @partkeys;
my $allcount = scalar(@partkeys);
my $ccount = scalar(@keys);
$debug and warn "Looking for $name under $allcount subelements, $ccount Composites: " . join(' ', @keys);
my @hits = grep {$name eq $_} @partkeys;
if (scalar @hits) {
} elsif ($ccount) {
my $spec = $self->spec or croak "You must set a spec version (via constructor or spec method) before EDI can autoload objects";
my $part = $spec->get_spec('composite');
foreach my $code (@keys) {
$part->{$code} or croak(ref($self) . " Object _permitted composite code '$code' not found in spec version " . $spec->version);
my @subparts = grep {$_->{code} eq $name} @{$part->{$code}->{parts}};
@subparts and push(@hits, map {$code} @subparts);
# important here, we add the Cxxx code once per hit in its subparts. Multiple hits means we cannot target cleanly.
}
}
my $hitcount = scalar(@hits);
$debug and warn "Found $name has $hitcount possible match(es) in $ccount Composites: " . join(' ', @hits);
if ($hitcount == 1) {
if (@_) {
return $self->{$hits[0]}->{$name} = shift;
} else {
return $self->{$hits[0]}->{$name};
}
} elsif ($hitcount > 1) {
croak "AUTOLOAD error: Cannot access '$name' field of class '" . ref($self) . "', "
. " $hitcount indeterminate matches in collapsable subelements";
}
# else hitcount == 0
$debug and $debug > 1 and print STDERR "FAILED _deepload of '$name' in object: ", Dumper($self);
croak "AUTOLOAD error: Cannot access '$name' field of class '" . ref($self)
. "' (or $allcount collapsable subelements, $ccount Composites)";
}
# Constructors
sub new {
my $class = shift;
my %args;
if (scalar @_ eq 1) {
$args{version} = shift;
} elsif (@_) {
scalar(@_) % 2 and croak "Odd number of arguments to new() incorrect. Use (name1 => value1) style.";
%args = @_;
}
my $stuff = {_permitted => {(map {$_ => 1} keys %fields)}, %fields};
foreach (keys %args) {
$_ eq 'version' and next; # special case
exists ($stuff->{_permitted}->{$_}) or croak "Unrecognized argument to new: $_ => $args{$_}";
}
my $self = bless($stuff, $class);
if ($args{version}) {
$self->spec(version => $args{version}) or croak "Unrecognized spec version '$args{version}'";
}
$debug and $debug > 1 and print Dumper($self);
return $self;
}
# BIG Complicated META-Constructors!!
sub _common_constructor {
my $self = shift;
my $type = shift or die "Internal error: _common_constructor called without required argument for object type";
my $spec = $self->spec or croak "You must set a spec version (via constructor or spec method) before EDI can create $type objects";
my $part = $spec->get_spec($type);
my $code = uc(shift) or croak "No $type code specified";
my $body = shift;
$part->{$code} or return $self->carp_error("$type code '$code' is not found amongst "
. scalar(keys %$part) ." ". $type . "s in spec version " . $spec->version); # . ": " . Dumper([sort keys %$part]));
unless (ref($body) eq 'HASH') {
return $self->carp_error("body argument for $type must be HASHREF, not '" . ref($body) . "'");
}
my @subparts = map {$_->{code}} @{$part->{$code}->{parts}};
my @required = map {$_->{code}} grep {$_->{mandatory}} @{$part->{$code}->{parts}};
my ($compspec, @compcodes);
my ( $segspec, @seggroups);
foreach (@subparts) {
/^SG\d+$/ and push(@seggroups, $_) and next;
/^C\d{3}$/ and push(@compcodes, $_) and next;
}
$compspec = $spec->get_spec('composite') if @compcodes;
# $segspec = $spec->get_spec('segment') if @seggroups;
my $normal;
# Now we normalize the body according to the spec (apply wrappers)
foreach my $key (keys %$body) {
if (grep {$key eq $_} @subparts) {
$normal->{$key} = $body->{$key}; # simple case
next;
}
elsif (@compcodes) {
my @hits;
foreach my $compcode (@compcodes) {
push @hits, map {$compcode} grep {$_->{code} eq $key} @{$compspec->{$compcode}->{parts}};
}
if (scalar(@hits) == 1) {
$normal->{$hits[0]}->{$key} = $body->{$key}; # only one place for it to go, so apply the wrapper
next;
} elsif (scalar(@hits) > 1) {
return $self->carp_error("$type subpart '$key' has " . scalar(@hits)
. " indeterminate matches under composites: " . join(', ', @hits)
);
}
return $self->carp_error("$type subpart '$key' not found in spec " . $spec->version);
}
}
$debug and printf STDERR "creating $type/$code with %d spec subpart(s): %s\n", scalar(@subparts), join(' ', @subparts);
# push @subparts, 'debug';
my $unblessed = $self->unblessed($normal, \@subparts);
$unblessed or return;
my $new = bless($unblessed, __PACKAGE__ . '::' . ucfirst($type));
$new->spec($spec);
$new->{_permitted}->{code} = 1;
$new->{_permitted}->{label} = 1;
$new->{code} = $code;
$new->{label} = $part->{$code}->{label};
# $new->debug($debug{$type}) if $debug{$type};
foreach (@required) {
unless (defined $new->part($_)) {
return $self->carp_error("Required field $type/$code/$_ not populated");
}
}
return $new;
}
sub _def_based_constructor {
my $self = shift;
my $type = shift or die "Internal error: _def_based_constructor called without required argument for object type";
my $spec = $self->spec or croak "You must set a spec version (via constructor or spec method) before EDI can create $type objects";
my $page = $self->spec_page($type); # page of the spec
my $code = uc(shift) or croak "No $type code specified";
my $body = shift;
my $message_code = (@_ and $_[0]) ? shift : '';
my $page_code;
if ($type eq 'message') {
$message_code = $code;
$page_code = $code;
} elsif ($type eq 'segment_group') {
$code =~ /^SG\d+$/ and $message_code and $code = "$message_code/$code";
$code =~ /^(\S+)\/(SG\d+)$/ or return $self->carp_error("Cannot spec $type '$code' without message. Use xpath style, like 'ORDERS/SG27'");
$page = $page->{$1} or return $self->carp_error("Message $1 does not have any " . $type . "s in spec version " . $spec->version);
$message_code = $1;
$page_code = $2;
# tighen spec down past message level based on first part of key
}
unless (ref($body) eq 'ARRAY') {
return $self->carp_error("body argument to $type() must be ARRAYREF, not '" . ref($body) . "'");
}
my @subparts = @{$page->{$page_code}->{parts}};
$debug and printf STDERR "creating $type/$code with %d spec subpart(s): %s\n", scalar(@subparts), join(' ', map {$_->{code}} @subparts);
$debug and print STDERR "calling \$self->unblessed_array(\$body, \$page->{$page_code}->{parts}, '$message_code')\n";
my $unblessed = $self->unblessed_array($body, \@subparts, $message_code); # doesn't yet support arrayref(?)
$unblessed or return;
my $new = bless($unblessed, __PACKAGE__ . '::' . ucfirst($type));
$new->spec($spec);
$new->{_permitted}->{code} = 1;
$new->{_permitted}->{message_code} = 1;
$new->{_permitted}->{label} = 1;
$new->{code} = $code;
$new->{message_code} = $message_code; # same as code for messages, different for SGs
$new->{label} = $page->{$page_code}->{label};
if ($type eq 'segment_group') {
$new->{sg_code} = $page_code;
}
return $new;
}
# Fundamental constructor calls for different object types
# These are here so you can just "use Business::EDI;" and not have to worry about using different
# modules for different data objects.
sub segment {
my $self = shift;
return $self->_common_constructor('segment', @_);
}
sub segment_group {
my $self = shift;
return $self->_def_based_constructor('segment_group', @_);
# The difference is that segment_group must deal with repeatable segments, other segment groups, etc.
}
# TODO: rename detect_version one something more clueful
# The difference is that message() expects you to have declared an EDI spec version already, whereas detect_version
# just looks at the contents of the passed data, attempting to extract the encoded version there.
sub detect_version {
my $self = shift;
return Business::EDI::Message->new(@_);
}
sub message {
my $self = shift;
# my $msg_code = shift;
#print Dumper ($body);
return $self->_def_based_constructor('message', @_);
}
sub dataelement {
my $self = shift;
# Business::EDI::DataElement->require;
Business::EDI::DataElement->new(@_);
}
sub composite {
my $self = shift;
# Business::EDI::DataElement->require;
Business::EDI::Composite->new(@_);
}
sub codelist {
my $self = shift;
# my $spec = $self->spec or croak "You must set a spec version (via constructor or spec method) before EDI can create objects";
# my $part = $spec->get_spec('message');
Business::EDI::CodeList->new_codelist(@_);
}
sub spec_page {
my $self = shift;
my $spec = $self->spec or croak "You must set a spec version (via constructor or spec method) before EDI can retrieve part of it";
@_ or return carp_error("Missing argument to spec_page()");
return $spec->get_spec(@_); # not $self->get_spec .... sorry
}
sub get_spec {
my $self = shift;
@_ or return carp_error("Missing argument to get_spec()");
return Business::EDI::Spec->new(@_);
}
# Accessor get/set methods
sub code {
my $self = shift;
@_ and $self->{code} = shift;
return $self->{code};
}
sub spec { # spec(code)
my $self = shift;
if (@_) { # Arg(s) mean we are constructing
ref($self) or return $self->get_spec(@_); # Business::EDI->spec(...) style, class method: simple constructor
if (ref($_[0]) eq 'Business::EDI::Spec') { # TODO: use isa or whatever the hip OO style of role-checking is
$self->{spec} = shift; # We got passed a full spec object, just set
} else {
$self->{spec} = $self->get_spec(@_); # otherwise construct and retain
}
}
ref($self) or croak "Cannot use class method Business::EDI->spec as an accessor (spec is uninstantiated). " .
"Get a spec'd object first like: Business::EDI->new('d87a')->spec, " .
"or specify the version you want: Business::EDI->spec('default') or Business::EDI->get_spec('default')";
return $self->{spec};
}
sub error {
my ($self, $msg, $quiet) = @_;
$msg or return $self->{error} || $error; # just an accessor
($debug or ! $quiet) and carp $msg;
return $self->{error} = $msg;
}
sub carp_error {
my $obj_or_message = shift;
my $msg;
if (@_) {
$msg = (ref($obj_or_message) || $obj_or_message) . ' - ' . shift;
} else {
$msg = $obj_or_message;
}
if (ref $obj_or_message) {
# do something?
}
carp $msg;
return; # undef: important!
}
# ->unblessed($body, \@codes)
sub unblessed { # call like Business::EDI->unblessed(\%hash, \@codes);
my $class = shift;
my $body = shift;
my $codesref = shift;
$body or return carp_error "1st required argument to unblessed() is EMPTY";
$codesref or return carp_error "2nd required argument to unblessed() is EMPTY";
unless (ref($body) eq 'HASH') {
return carp_error "1st argument to unblessed() must be HASHREF, not '" . ref($body) . "'";
}
unless (ref($codesref) eq 'ARRAY') {
return carp_error "2nd argument to unblessed() must be ARRAYREF, not '" . ref($codesref) . "'";
}
$debug and printf STDERR "good: unblessed() got body and definition: %s/%s topnodes/defs\n", scalar(keys %$body), scalar(@$codesref); #, Dumper($body), "\n";
my $self = {};
foreach (@$codesref) {
$self->{_permitted}->{$_} = 1;
$body->{$_} or next;
$self->{$_} = Business::EDI->subelement({$_ => $body->{$_}}) || $body->{$_};
}
return $self;
}
# array based object creation (segment groups)
# allows repeatable subobjects
# enforces mandatory subobjects
sub unblessed_array { # call like Business::EDI->unblessed_array(\@pseudo_hashes, \@code_objects);
my $class = shift;
my $body = shift;
my $codesref = shift;
my $msg = (@_ and $_[0]) ? shift : '';
# my $msg = 'ORDRSP';
my $strict = 0;
$body or return carp_error "1st required argument 'x' to unblessed_array(x,y,'$msg') is EMPTY";
$codesref or return carp_error "2nd required argument 'y' to unblessed_array(x,y,'$msg') is EMPTY";
unless (ref($body) eq 'ARRAY') {
return carp_error "1st argument to unblessed_array() must be ARRAYREF, not '" . ref($body) . "'";
}
unless (ref($codesref) eq 'ARRAY') {
return carp_error "2nd argument to unblessed_array() must be ARRAYREF, not '" . ref($codesref) . "'";
}
$debug and printf STDERR "good: unblessed_array() got body and definition: %s/%s topnodes/defs\n", scalar(@$body), scalar(@$codesref); #, Dumper($body), "\n";
my $self = {
array => [], # subelements get pushed in here
def => $codesref,
_permitted => {array => 1, def => 1},
};
my $sg_specs = $class->spec_page('segment_group') or croak "Cannot get Segment Group definitions";
my $msg_sg_specs = $sg_specs->{$msg} or croak "ERROR: $msg Segment Groups not defined in spec";
my $codecount = scalar @$codesref;
my $j = 0; # index for @$codesref
my $repeats = 0;
my $last_matched = '';
my $i;
if (@$body == 2 and ref($body->[0]) eq '') {
# push @{$self->{array}}, $class->_subelement_helper($body->[0], $body->[1], $msg);
# return $self;
$body = [ [$body->[0], $body->[1]] ];
}
BODYPART: for ($i=0; $i < @$body; $i++) {
my $bodypart = $body->[$i];
# next if ref($bodypart) =~ /)^Business::EDI::/;
unless (ref($bodypart) eq 'ARRAY') {
warn "Malformed data. Bodypart $i is expected to be pseudohash ARRAYREF, not "
. (ref($bodypart) || "a scalar='$bodypart'") . ". Skipping it...";
next;
}
my $key = $bodypart->[0];
$debug and print "BODYPART $i: $key\n";
while ($j < $codecount) {
my $def = $codesref->[$j];
$debug and printf STDERR "BODYPART $i: $key comparing to def $j: %5s %s\n", $def->{code}, ($key eq $def->{code} ? 'MATCH!' : '');
if ($key eq $def->{code}) {
$last_matched = $key;
my $limit = $def->{repeats}; # checking the PREVIOUS def to see if it allows repetition
if (++$repeats <= $limit) {
push @{$self->{array}}, $class->_subelement_helper($key, $bodypart->[1], $msg);
} else {
$strict and die "Code '$key' is limited to $limit occurrences. Dropping data!!";
warn "Code '$key' is limited to $limit occurrences. Dropping data!!";
}
next BODYPART;
}
# check if this def was mandatory (satisfied if we already added it)
if ($def->{mandatory} and $def->{code} !~ /^UN.$/ and not $repeats) {
my $msg = "Mandatory code '" . $def->{code} . "' from definition $j missing or out of position (last found '$key' at position $i)";
$strict and return carp_error $msg;
$debug and warn $msg;
}
$repeats = 0;
$j++; # move the index to the next rule
}
# now either we matched, or we ran out of tries
if ($j >= $codecount) { # if we ran out of tries, error
my $msg = "All $j subelements exhausted. Code '$key' from position $i not matched";
$strict and return carp_error $msg;
$debug and warn $msg; # FIXME: this happens too often
}
}
return $self;
# We're out of parts, so time to check for any outstanding mandatory defs (same kind of loop)
# This check doesn't work because a subelement can be mandatory in a given optional element. Context matters.
while (++$j < $codecount) {
$codesref->[$j]->{mandatory} and return carp_error
"Mandatory code '" . $codesref->[$j]->{code} . "' from definition $j missing (all ". $i+1 . " data traversed)";
}
}
sub _subelement_helper {
my ($class, $key, $body, $msg) = @_;
if ($key =~ /^[A-Z]{3}$/) {
$debug and print STDERR "SEGMENT ($key) detected\n";
return $class->segment($key => $body);
} else {
return $class->subelement({$key => $body}, $msg);
}
}
# Similar to AUTOLOAD, but by an exact argument, does get and set
# This code should parallel AUTOLOAD tightly.
sub part {
my $self = shift;
my $class = ref($self) or croak "part() object method error: $self is not an object";
my $name = shift or return;
unless (exists $self->{_permitted}->{$name}) {
if ($self->{def}) {
if ($name =~ s/^all_(.+)$/$1/i) { # strip 'all_' prefix
@_ and croak "part() error: all_$name is read_only, rec'd argument(s): " . join(', ', @_);
if ($debug) {
warn "part() " . $self->{code} . "/all_$name (from " . scalar(@{$self->{array}}) . " arrayed elements): "
. join(' ', map {$_->{code}} @{$self->{array}});
$debug > 1 and print STDERR Dumper($self), "\n";
}
my $target = $name =~ /^SG\d+$/ ? ($self->{message_code} . "/$name") : $name;
return grep {$_->{code} and $_->{code} eq $target} @{$self->{array}}; # return array
}
return __PACKAGE__->_deepload_array($self, $name, @_); # not $self->_deepload_array - avoid recursion
}
return __PACKAGE__->_deepload($self, $name, @_); # not $self->_deepload - avoid recursion
}
if (@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
# part_keys gives you values that are always valid as the argument to the same object's part() method
# TODO: mix/match both _permitted and def based? Maybe.
sub part_keys {
my $self = shift;
if ($self->{def}) {
return map { my $key = $_->{code}; $_->{repeats} > 1 ? "all_$key" : $key } @{$self->{def}};
}
return keys %{$self->{_permitted}};
# my $spec = $self->spec or croak "You must set a spec version (via constructor or spec method) before EDI can know what parts an $self object might have";
}
# Example data:
# 'BGM', {
# '1004' => '582822',
# '4343' => 'AC',
# '1225' => '29',
# 'C002' => {
# '1001' => '231'
# }
# }
our $codelist_map;
# Tricky recursive constructor!
sub subelement {
my $self = shift;
my $body = shift;
my $message_code = (@_ and $_[0]) ? shift : '';
if (! $body) {
carp "required argument to subelement() empty";
return;
}
unless (ref $body) {
$debug and carp "subelement() got a regular scalar argument. Returning it ('$body') as subelement";
return $body;
}
ref($body) =~ /^Business::EDI/ and return $body; # it's already an EDI object, return it
if (ref($body) eq 'ARRAY') {
if (scalar(@$body) != 2) {
carp "Array expected to be psuedohash with 2 elements, or wrapper with 1, instead got " . scalar(@$body);
return; # [(map {ref($_) ? $self->subelement($_) : $_} @$body)]; # recursion
} else {
$body = {$body->[0] => $body->[1]};
}
}
elsif (ref($body) ne 'HASH') {
carp "argument to subelement() should be ARRAYref or HASHref or Business::EDI subobject, not type '" . ref($body) . "'";
return;
}
$debug and print STDERR "good: we now have a body in class " . (ref($self) || $self) . " with " . scalar(keys %$body) . " key(s): ", join(', ', keys %$body), "\n";
$codelist_map ||= Business::EDI::CodeList->codemap;
my $new = {};
foreach (keys %$body) {
$debug and print STDERR "subelement building from key '$_'\n";
my $ref = ref($body->{$_});
if ($codelist_map->{$_}) { # If the key is in the codelist map, it's a codelist
$new->{$_} = $self->codelist($_, $body->{$_})
or carp "Bad ref ($ref) in body for key $_. Codelist subelement not created";
} elsif (/^C\d{3}$/ or /^S\d{3}$/) {
$new->{$_} = Business::EDI::Composite->new({$_ => $body->{$_}}) # Cxxx and Sxxx codes are for Composite data elements
or carp "Bad ref ($ref) in body for key $_. Composite subelement not created";
} elsif (/^[A-Z]{3}$/) {
$new->{$_} = $self->segment($_, $body->{$_}) # ABC codes are for Segments
or carp "Bad ref ($ref) in body for key $_. Segment subelement not created";
} elsif (/^(\S+\/)?(SG\d+)$/) {
my $sg_spec = $_;
my $msg = $1;
my $sg_tag = $2;
$sg_spec =~ s/\/\S+\//\//; # delete middle tags: ORDRSP/SG25/SG26 => ORSRSP/SG26
$new->{$sg_spec} = $self->segment_group(($msg ? $sg_spec : "$message_code/$sg_tag"), $body->{$_}, $message_code) # SGx[x] codes are for Segment Groups
or carp "Bad ref ($ref) in body for key $_. Segment_group subelement not created";
} elsif ($ref eq 'ARRAY') {
my $count = scalar(@{$body->{$_}});
$count == 1 or carp "Repeated section '$_' appears $count times. Only handling first appearance"; # TODO: fix this
$new->{repeats}->{$_} = -1;
$new->{$_} = $self->subelement($body->{$_}->[0], $message_code) # ELSE, break the ref down (recursively)
or carp "Bad ref ($ref) in body for key $_. Subelement not created";
} elsif ($ref) {
$new->{$_} = $self->subelement($body->{$_}, $message_code) # ELSE, break the ref down (recursively)
or carp "Bad ref ($ref) in body for key $_. Subelement not created";
} else {
$new->{$_} = Business::EDI::DataElement->new($_, $body->{$_}); # Otherwise, a terminal (non-ref) data node means it's a DataElement
# like Business::EDI::DataElement->new('1225', '582830');
}
(scalar(keys %$body) == 1) and return $new->{$_}; # important: if that's our only key/pair, return the object itself, no wrapper.
}
return $new;
}
# not really xpath, but xpath-lite-like. the idea here is to never crash on a valid path, just return undef.
sub xpath {
my $self = shift;
my $path = shift or return;
my $class = ref($self) or croak "xpath() object method error: $self is not an object";
$path eq '/' and return $self;
$path =~ m#([^-A-z_0-9/\.])# and croak "xpath does not handle '$1' in the path, just decending paths like 'SG27/LIN/1229'";
$path =~ m#(//)# and croak "xpath does not handle '$1' in the path, just decending paths like 'SG27/LIN/1229'";
$path =~ m#^/# and croak "xpath does not handle leading slashes in the path, just decending relative paths like 'SG27/LIN/1229'";
my ($front, $back) = split "/", $path, 2;
defined $front or $front = '';
defined $back or $back = '';
$debug and print STDERR $class . "->xpath($path) ==> ->part($front)->xpath($back);\n";
if ($front) {
$back or return $self->part($front); # no trailing part means we're done!
my @ret;
push @ret, $self->part($front) or return; # front might return multiple hits ('all_SG3', for example)
return grep {defined $_} map {$_->xpath($back)} @ret;
}
croak "xpath does not handle leading slashes in the path, just decending relative paths like 'SG27/LIN/1229'";
}
sub xpath_value {
my $self = shift;
my @hits = $self->xpath(@_);
@hits or return;
wantarray or return $hits[0]->value;
return map {$_->value} @hits;
}
our $cgi;
# Write your own CSS
sub html {
my $self = shift;
my $empties = @_ ? shift : 0;
my $indent = @_ ? shift : 0;
my $obtype = ref $self or return $self;
my $x = ' ' x $indent;
my $extra = '';
$obtype =~ s/^Business::EDI::// or return "$x
$obtype object
";
if ($obtype =~ /::(.*)$/) {
$extra = " edi_$1";
$extra =~ s/::/_/;
$obtype =~ s/::.*$//;
}
my $html = "$x";
}
1;
# END of Business::EDI
# =======================================================================================
package Business::EDI::Segment_group;
use strict; use warnings;
use Carp;
use base qw/Business::EDI/;
our $VERSION = 0.02;
our $debug;
sub sg_code {
my $self = shift or return;
@_ and croak "sg_code is read only (no args)";
return $self->{sg_code};
}
sub desc { # build a description on the fly
my $self = shift or return;
my $sgcode = $self->sg_code;
$sgcode =~ s/^SG//i;
return $self->{message_code} . " Segment Group $sgcode";
}
# Business::EDI::Segment_group gets its own part method to handle meta-mapped SGs INSIDE other SGs,
# but it falls back to the main part method after that.
sub part {
my $self = shift;
my $class = ref($self) or croak("part object method error: $self is not an object");
my $name = shift or return;
my $code = $self->{message_code} or return $self->carp_error("Message type (code) unset. Cannot assess metamapping.");
my $spec = $self->{spec} or return $self->carp_error("Message spec (code) unset. Cannot assess metamapping.");
my $sg = $spec->metamap($code, $name);
my $str_spec = "in spec " . $spec->version;
if ($sg) {
$debug and warn "SG Message/field '$code/$name' ==> '$code/all_$sg' via mapping $str_spec";
if ($sg =~ /\//) {
my $obj;
my @chunks = split '/', $sg;
my $first = shift @chunks;
my $last = pop @chunks;
$first eq $self->{sg_code} or return $self->carp_error("Mapped target $sg descends from $code/$first $str_spec, not " . $self->{sg_code});
foreach (@chunks) {
$obj = $obj ? $obj->SUPER::part("all_$_") : $self->SUPER::part("all_$_");
$obj or warn "Mapped SG $sg part 'all_$_' not found $str_spec";
$obj or return;
}
return $obj ? $obj->SUPER::part("all_$last", @_) : $self->SUPER::part("all_$last", @_); # only the last part gets the remaining args
} else {
return $self->carp_error("Mapped target $sg is not under " . $self->{code} . " $str_spec");
}
} else {
$debug and warn "Message/field '$code/$name' not mapped $str_spec. Skipping metamapping";
}
return $self->SUPER::part($name, @_);
}
1;
package Business::EDI::Message;
use strict; use warnings;
use Carp;
use base qw/Business::EDI/;
our $VERSION = 0.02;
our $debug;
# Business::EDI::Message gets its own part method to handle meta-mapped SGs,
# but it falls back to the main part method after that.
sub part {
my $self = shift;
my $class = ref($self) or croak("part object method error: $self is not an object");
my $name = shift or return;
my $code = $self->{message_code} or return carp_error("Message type (code) unset. Cannot assess metamapping.");
my $spec = $self->{spec} or return carp_error("Message spec (code) unset. Cannot assess metamapping.");
my $sg = $spec->metamap($code, $name);
if ($sg) {
$sg =~ s#/#/all_#; # e.g. SG26/SG30 => SG26/all_SG30
$debug and warn "Message/field '$code/$name' => '$code/all_$sg' via mapping";
$name = "all_$sg"; # new target from mapping
} else {
$debug and warn "Message/field '$code/$name' not mapped. Skipping metamapping";
}
return $self->SUPER::part($name, @_);
}
# This is a very high level method.
# We look inside a message body BEFORE we know what it is, and what spec it was written to.
# Second argument is a flag for "string only", in which case we just return the composed version string (e.g. 'D96A')
# otherwise we return a Business::EDI::Message object, or undef on failure.
#
# my $message = Business:EDI::Message->new($body);
# my $version = Business:EDI::Message->new($body, 1);
#
# Handles ALL valid message types
sub new {
my $class = shift;
my $body = shift or return $class->carp_error("missing required argument to detect_version()");
ref($body) eq 'ARRAY' or return $class->carp_error("detect_version_string argument must be ARRAYref, not '" . ref($body) . "'");
foreach my $node (@$body) {
my ($tag, $segbody, @xtra) = @$node;
unless ($tag) { carp "EDI tag received is empty"; next };
unless ($segbody) { carp "EDI segment '$tag' has no body"; next }; # IIIIIIiiii, ain't got noboooOOoody!
if (scalar @xtra) { carp scalar(@xtra) . " unexpected extra elements encountered in detect_version(). Ignoring!";}
$tag eq 'UNH' or next;
my $agency = $segbody->{S009}->{'0051'}; # Thankfully these are true in all syntaxes/specs
my $pre = $segbody->{S009}->{'0052'};
my $release = $segbody->{S009}->{'0054'};
my $type = $segbody->{S009}->{'0065'};
$agency and $agency eq 'UN' or return $class->carp_error("$tag/S009/0051 does not designate 'UN' as controlling agency");
$pre and uc($pre) eq 'D' or return $class->carp_error("$tag/S009/0052 does not designate 'D' as spec (prefix) version");
$release or return $class->carp_error("$tag/S009/0054 (spec release version) is empty (example value: '96A')");
@_ and $_[0] and return "$pre$release"; # "string only"
my $edi = Business::EDI->new(version => "$pre$release") or
return $class->carp_error("Spec unrecognized: Failed to create new Business::EDI object with version => '$pre$release'");
return $edi->message($type, $body);
}
}
1;
__END__
=head1 NAME
Business::EDI - Top level class for generating U.N. EDI interchange objects and subobjects.
=head1 SYNOPSIS
use Business::EDI;
my $edi = Business::EDI-new('d09b'); # set the EDI spec version
my $rtc = $edi->codelist('ResponseTypeCode', $json) or die "Unrecognized code!";
printf "EDI response type: %s - %s (%s)\n", $rtc->code, $rtc->label, $rtc->value;
my $msg = Business::EDI::Message->new($ordrsp) or die "Failed Message constructor";
foreach ($msg->xpath('line_detail/all_LIN') {
($_->part(7143) || '') eq 'EN' or next;
print $_->part(7140)->value, "\n"; # print all the 13-digit (EN) ISBNs
}
=head1 DESCRIPTION
The focus of functionality is to provide object based access to EDI messages and subelements.
At present, the EDI input processed by Business::EDI objects is JSON from the B ruby library, and
there is no EDI output beyond the perl objects themselves.
=head1 NAMESPACE
When you C