From 74659875170768fdf3547aeb0b0a4bff5ff49a50 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 Jul 2020 18:33:59 +0000 Subject: [PATCH 1/6] Restyled by clang-format --- bin/pem.js | 65 +- protocol/index.js | 8 +- protocol/server.js | 21 +- protocol/validate-document.js | 71 +- spec_abnf/abnf/Rule5010270.js | 511 +++--- .../generateacknowledgement/enummap.js | 117 +- test_harness/generateacknowledgement/index.js | 75 +- test_harness/validatedocument/enummap.js | 117 +- test_harness/validatedocument/index.js | 73 +- test_harness/x12_test_harness/group.js | 214 +-- test_harness/x12_test_harness/schema.js | 48 +- test_harness/x12_test_harness/segment.js | 73 +- .../testFiles/835/profee-done.js | 1486 ++++++++--------- test_harness/x12_test_harness/x12grouper.js | 162 +- test_harness/x12_test_harness/x12parser.js | 119 +- 15 files changed, 1582 insertions(+), 1578 deletions(-) diff --git a/bin/pem.js b/bin/pem.js index a89b9f1..40ff401 100644 --- a/bin/pem.js +++ b/bin/pem.js @@ -16,36 +16,39 @@ async function run() { let publicpem = fs.readFileSync("./device.crt", "utf8"); let publickey = await keystore.add(publicpem, "pem"); - // we need the public key chain in x5c header. x5c header chain will be used during - // decode, a full cert can be provided to ensure validation all the way to root + // we need the public key chain in x5c header. x5c header chain will be used + // during decode, a full cert can be provided to ensure validation all the + // way to root // https://tools.ietf.org/html/draft-ietf-jose-json-web-key-41#page-9 - // unfortunately we can't just use plain jwk, since jwk is only the *key* and not the - // full *certificate*, so ... x5c it is + // unfortunately we can't just use plain jwk, since jwk is only the *key* + // and not the full *certificate*, so ... x5c it is let x5cChain = cert_to_x5c(publicpem); // the message body let message = JSON.stringify({ - iss: "vendor", - sub: "1234", - exp: Date.now() + 10 * 60 * 1000, // expires in 10 minutes - iat: Date.now(), - bundle: "...", + iss : "vendor", + sub : "1234", + exp : Date.now() + 10 * 60 * 1000, // expires in 10 minutes + iat : Date.now(), + bundle : "...", }); // and signing options - let signoptions = { fields: { x5c: x5cChain } }; + let signoptions = {fields : {x5c : x5cChain}}; - // sign 'message' with the 'privatekey', include the 'x5c' chain in the headers + // sign 'message' with the 'privatekey', include the 'x5c' chain in the + // headers let signed = await jose.JWS.createSign(signoptions, privatekey) - .update(message, "utf8") - .final(); + .update(message, "utf8") + .final(); // bet you didn't think it would be that big console.log(signed); console.log("//////////////////////////////"); - // a quick sanity check - the cisco/node-jose lib provides x5c verification fortunately + // a quick sanity check - the cisco/node-jose lib provides x5c verification + // fortunately let result = await jose.JWS.createVerify().verify(signed); console.log(JSON.parse(result.payload)); @@ -61,10 +64,10 @@ async function run() { console.log("message expiry valid"); } - // and .. it doesn't do the full x509 cert verification, it just checks that the - // key from the first cert in the x5c header can verify the payload so now, we - // need to shell out to openssl to verify that the provided key was signed by the CA - // why oh why is there nothing native for this + // and .. it doesn't do the full x509 cert verification, it just checks that + // the key from the first cert in the x5c header can verify the payload so + // now, we need to shell out to openssl to verify that the provided key was + // signed by the CA why oh why is there nothing native for this let cert = await x5c_to_cert(result.header.x5c); // load the CA @@ -86,7 +89,8 @@ run(); function verifySigningChain(cert, cacert) { return new Promise((resolve, reject) => { pem.verifySigningChain(cert, cacert, (err, ver) => { - if (err) return reject(err); + if (err) + return reject(err); return resolve(ver); }); }); @@ -100,16 +104,15 @@ function cert_to_x5c(cert, maxdepth) { } /* * Convert a PEM-encoded certificate to the version used in the x5c element - * of a [JSON Web Key](http://tools.ietf.org/html/draft-ietf-jose-json-web-key). + * of a [JSON Web + * Key](http://tools.ietf.org/html/draft-ietf-jose-json-web-key). * * `cert` PEM-encoded certificate chain * `maxdepth` The maximum number of certificates to use from the chain. */ cert = cert.replace(/-----[^\n]+\n?/gm, ",").replace(/\n/g, ""); - cert = cert.split(",").filter(function (c) { - return c.length > 0; - }); + cert = cert.split(",").filter(function(c) { return c.length > 0; }); if (maxdepth > 0) { cert = cert.splice(0, maxdepth); } @@ -118,13 +121,13 @@ function cert_to_x5c(cert, maxdepth) { function x5c_to_cert(x5c) { var cert, y; - cert = (function () { - var _i, _ref, _results; - _results = []; - for (y = _i = 0, _ref = x5c.length; _i <= _ref; y = _i += 64) { - _results.push(x5c.slice(y, +(y + 63) + 1 || 9e9)); - } - return _results; - })().join("\n"); + cert = (function() { + var _i, _ref, _results; + _results = []; + for (y = _i = 0, _ref = x5c.length; _i <= _ref; y = _i += 64) { + _results.push(x5c.slice(y, +(y + 63) + 1 || 9e9)); + } + return _results; + })().join("\n"); return "-----BEGIN CERTIFICATE-----\n" + cert + "\n-----END CERTIFICATE-----"; } diff --git a/protocol/index.js b/protocol/index.js index e5b6b6d..4fdc92e 100644 --- a/protocol/index.js +++ b/protocol/index.js @@ -2,12 +2,12 @@ let fileLoader = new FreightTrustLib.EDIFileLoader(); fileLoader.AutoDetectDelimiters = true; let file = - "ISA*00* *00* *ZZ*133052274 *ZZ*311279999 *120419*2125*^*00501*000002120*0*P*<~GS*HC*133052274*311279999*20120419*212549*2120*X*005010X222A1~ST*837*000000533*005010X222A1~BHT*0019*00*000017120*20120419*212550*CH~NM1*41*2*CS*****46*133052274~PER*IC*CUSTOMER SOLUTIONS*TE*8008456592~NM1*40*2*RECEIVER*****46*311279999~HL*1**20*1~NM1*85*2*BILLING PROVIDER*****XX*1215954003~N3*1540 SUNDAY DRIVE~N4*RALEIGH*NC*276076000~REF*EI*569999999~NM1*87*2~N3*P O BOX 63146~N4*CHARLOTTE*NC*282633146~HL*2*1*22*0~SBR*P*18*******CI~NM1*IL*1*SMITH*JOHN****MI*505XXXX~N3*2345 NORTH RD~N4*SPRINGFIELD*NY*11111~DMG*D8*19950101*F~NM1*PR*2*BLUE CROSS*****PI*XX123A~N3*PO BOX 78765~N4*SOUTH BEACH*FL*23466~CLM*1029353-03*553.96***111[ST,M][BHT,M]{2000A:>1[HL*1,M]{2100A:1[NM1*4,M]}{2000B:>1[HL*2,M]{2100B:1[NM1*4,M][REF,O,9][N3][N4*1][PRV*1]}{2000C:>1[HL*2,M][TRN,O,2]{2100C:1[NM1*2,M][REF*1,O,9][N3][N4*1][PRV*1][DMG*1][INS*1][HI*1][DTP,O,2]{2110C:99[EQ*1][AMT*1][AMT*1][III][REF*1][DTP]}{2000D:>1[HL*2,X][TRN,O,2]{2100D:1[NM1*3,M][REF*1,O,9][N3][N4*3][PRV*1][DMG*1][INS*2][HI*1][DTP,O,2]{2110D:99[EQ*2,M][III][REF*1][DTP]}}}}}}}{END ST HEADER LOOP:1[SE,M]}}{END GS LOOP:1[GE,M]}}{END ISA LOOP:1[IEA,M]}}\n" + - "ELEMENT CODES\n" + - "101=1:1,00,03\n" + - "103=1:3,00,01\n" + - "105=1:5,01,14,20,27,28,29,30,33,ZZ*1:7,01,14,20,27,28,29,30,33,ZZ\n" + - "111=1:12,00501\n" + - "113=1:14,0,1\n" + - "114=1:15,P,T\n" + - "479=2:1,HS\n" + - "455=2:7,X\n" + - "480=2:8,005010X279A1\n" + - "143=3:1,270\n" + - "1705=3:3,005010X279A1\n" + - "1005=4:1,0022\n" + - "353=4:2,01,13\n" + - "640=4:6,RT\n" + - "735=5:3,20*7:3,21*13:3,22*30:3,23\n" + - "736=5:4,1*7:4,1*13:4,0,1*30:4,0\n" + - "98=6:1,2B,36,GP,P5,PR*8:1,1P,2B,36,80,FA,GP,P5,PR*15:1,IL*32:1,03\n" + - "1065=6:2,1,2*8:2,1,2*15:2,1,2*32:2,1\n" + - "66=6:8,24,46,FI,NI,PI,XV,XX*8:8,24,34,FI,PI,PP,SV,XV,XX*15:8,II,MI\n" + - "128=9:1,0B,1C,1D,1J,4A,CT,EL,EO,HPI,JD,N5,N7,Q4,SY,TJ*12:2,PXC*16:1,18,1L,1W,3H,6P,CT,EA,EJ,F6,GH,HJ,IG,N6,NQ,SY,Y4*19:2,9K,D3,EI,HPI,PXC,SY,TJ*28:1,9F,G1*33:1,18,1L,1W,6P,CT,EA,EJ,F6,GH,HJ,IF,IG,MRC,N6,SY,Y4*36:2,9K,D3,EI,HPI,PXC,SY,TJ*43:1,9F,G1\n" + - "1221=12:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SB,SK,SU*19:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU*36:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU\n" + - "481=14:1,1*31:1,1\n" + - "1250=20:1,D8*23:2,D8,RD8*29:2,D8,RD8*37:1,D8*40:2,D8,RD8*44:2,D8,RD8\n" + - "1068=20:3,F,M*37:3,F,M\n" + - "1073=21:1,Y*38:1,N\n" + - "1069=21:2,18*38:2,01,19,34\n" + - "1270=22:1:1,ABK,BK*22:2:1,ABF,BF*22:3:1,ABF,BF*22:4:1,ABF,BF*22:5:1,ABF,BF*22:6:1,ABF,BF*22:7:1,ABF,BF*22:8:1,ABF,BF*27:1,ZZ*39:1:1,ABK,BK*39:2:1,ABF,BF*39:3:1,ABF,BF*39:4:1,ABF,BF*39:5:1,ABF,BF*39:6:1,ABF,BF*39:7:1,ABF,BF*39:8:1,ABF,BF*42:1,BF,BK,ZZ\n" + - "374=23:1,102,291*29:1,291*40:1,102,291*44:1,291\n" + - "1365=24:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,B1,B2,B3,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,C1,CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM,CN,CO,CP,CQ,DG,DM,DS,GF,GN,GY,IC,MH,NI,ON,PT,PU,RN,RT,TC,TN,UC*41:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS\n" + - "235=24:2:1,AD,CJ,HC,ID,IV,N4,ZZ*41:2:1,AD,CJ,HC,ID,IV,N4,ZZ\n" + - "1207=24:3,FAM*41:3,CHD,DEP,ECH,EMP,ESP,FAM,IND,SPC,SPO\n" + - "522=25:1,R*26:1,PB\n" + - "1336=41:4,AP,C1,CO,HM,IP,OT,PR,PS,SP,WC\n" + - "ELEMENT FORMATS\n" + - "1251=20:2,0,,Date CCYYMMDD\n" + - "SUMMARY\n" + - "ELEMENT EQUALITY\n" + - "1:13=47:2\n" + - "3:2=45:2\n" + - "RULES\n" + - "24=13:4'EQ'0!USAGE!2!1\n" + - "30=13:4'EQ'1!USAGE!2!1\n" + - "ELEMENT COUNTERS\n" + - "ELEMENT CODE DESCRIPTION\n" + - "LOOP DESCRIPTIONS\n" + - "INTERCHANGE HEADER=START OF INTERCHANGE HEADER\n" + - "FUNCTIONAL GROUP=START OF FUNCTIONAL GROUP\n" + - "ST HEADER=START OF ST HEADER\n" + - "2000A=INFORMATION SOURCE LEVEL\n" + - "2100A=INFORMATION SOURCE NAME\n" + - "2000B=INFORMATION RECEIVER LEVEL\n" + - "2100B=INFORMATION RECEIVER NAME\n" + - "2000C=SUBSCRIBER LEVEL\n" + - "2100C=SUBSCRIBER NAME\n" + - "2110C=SUBSCRIBER ELIGIBILITY OR BENEFIT INQUIRY\n" + - "2000D=DEPENDENT LEVEL\n" + - "2100D=DEPENDENT NAME\n" + - "2110D=DEPENDENT ELIGIBILITY OR BENEFIT INQUIRY\n" + - "END ST HEADER LOOP=END ST HEADER LOOP\n" + - "END GS LOOP=END OF FUNCTIONAL HEADER\n" + - "END ISA LOOP=END OF INTERCHANGE HEADER\n" + - "SEGMENT DESCRIPTIONS\n" + - "ISA=1,Interchange Header\n" + - "GS=2,Functional Group\n" + - "ST=3,Transaction Set Header\n" + - "BHT=4,Beginning of Hierarchical Transaction\n" + - "HL=5,Information Source Level\n" + - "NM1=6,Information Source Name\n" + - "HL=7,Information Receiver Level\n" + - "NM1=8,Information Receiver Name\n" + - "REF=9,Information Receiver Additional Identification\n" + - "N3=10,Information Receiver Address\n" + - "N4=11,Information Receiver City\n" + - "PRV=12,Information Receiver Provider Information\n" + - "HL=13,Subscriber Level\n" + - "TRN=14,Subscriber Trace Number\n" + - "NM1=15,Subscriber Name\n" + - "REF=16,Subscriber Additional Identification\n" + - "N3=17,Subscriber Address\n" + - "N4=18,Subscriber City\n" + - "PRV=19,Provider Information\n" + - "DMG=20,Subscriber Demographic Information\n" + - "INS=21,Multiple Birth Sequence Number\n" + - "HI=22,Subscriber Health Care Diagnosis Code\n" + - "DTP=23,Subscriber Date\n" + - "EQ=24,Subscriber Eligibility or Benefit Inquiry\n" + - "AMT=25,Subscriber Spend Down Amount\n" + - "AMT=26,Subscriber Spend Down Total Billed Amount\n" + - "III=27,Subscriber Eligibility or Benefit Additional Inquiry Information\n" + - "REF=28,Subscriber Additional Information\n" + - "DTP=29,Subscriber Eligibility/Benefit Date\n" + - "HL=30,Dependent Level\n" + - "TRN=31,Dependent Trace Number\n" + - "NM1=32,Dependent Name\n" + - "REF=33,Dependent Additional Identification\n" + - "N3=34,Dependent Address\n" + - "N4=35,Dependent City\n" + - "PRV=36,Provider Information\n" + - "DMG=37,Dependent Demographic Information\n" + - "INS=38,Dependent Relationship\n" + - "HI=39,Dependent Health Care Diagnosis Code\n" + - "DTP=40,Dependent Date\n" + - "EQ=41,Dependent Eligibility or Benefit Inquiry\n" + - "III=42,Dependent Eligibility or Benefit Additional Inquiry Information\n" + - "REF=43,Dependent Additional Information\n" + - "DTP=44,Dependent Eligibility/Benefit Date\n" + - "SAMPLE DATA"; +let + Rule5010270 = + "FILE DATA\n" + + "Version=005010X279A1\n" + + "Description=270 Eligibility, Coverage or Benefit Inquiry\n" + + "ELEMENT DEFINITIONS\n" + + "19=AN,2,30,City Name\n" + + "26=ID,2,3,Country Code\n" + + "28=NO,1,9,Group Control Number\n" + + "66=ID,1,2,Identification Code Qualifier\n" + + "67=AN,2,80,Identification Code\n" + + "93=AN,1,60,Name\n" + + "96=NO,1,10,Number of Included Segments\n" + + "97=NO,1,6,Number of Transaction Sets Included\n" + + "98=ID,2,3,Entity Identifier Code\n" + + "101=ID,2,2,Authorization Information Qualifier\n" + + "102=AN,10,10,Authorization Information\n" + + "103=ID,2,2,Security Information Qualifier\n" + + "104=AN,10,10,Security Information\n" + + "105=ID,2,2,Interchange ID Qualifier\n" + + "106=AN,15,15,Interchange Sender ID\n" + + "107=AN,15,15,Interchange Receiver ID\n" + + "108=DT,6,6,Interchange Date\n" + + "109=TM,4,4,Interchange Time\n" + + "110=ID,1,1\n" + + "111=ID,5,5,Interchange Control Version Number\n" + + "112=NO,9,9,Interchange Control Number\n" + + "113=ID,1,1,Acknowledgment Requested\n" + + "114=ID,1,1,Interchange Usage Indicator\n" + + "115=ID,1,1,Component Element Separator\n" + + "116=ID,3,15,Postal Code\n" + + "124=AN,2,15,Application Receiver Code\n" + + "127=AN,1,50,Reference Identification\n" + + "128=ID,2,3,Reference Identification Qualifier\n" + + "142=AN,2,15,Application Sender Code\n" + + "143=ID,3,3,Transaction Set Identifier Code\n" + + "156=ID,2,2,State or Province Code\n" + + "165=ID,1,1,Repetition Separator\n" + + "166=AN,1,55,Address Information\n" + + "234=AN,1,48,Product/Service ID\n" + + "235=ID,2,2,Product/Service ID Qualifier\n" + + "309=ID,1,2,Location Qualifier\n" + + "310=AN,1,30,Location Identifier\n" + + "329=AN,4,9,Transaction Set Control Number\n" + + "337=TM,4,8,Time\n" + + "352=AN,1,80,Description\n" + + "353=ID,2,2,Transaction Set Purpose Code\n" + + "364=AN,1,80,Communication Number\n" + + "365=ID,2,2,Communication Number Qualifier\n" + + "366=ID,2,2,Contact Function Code\n" + + "373=DT,8,8,Date\n" + + "374=ID,3,3,Date/Time Qualifier\n" + + "380=R,1,15,Quantity\n" + + "455=ID,1,2,Responsible Agency Code\n" + + "478=ID,1,1,Credit/Debit Flag Code\n" + + "479=ID,2,2,Functional Identifier Code\n" + + "480=AN,1,12,Version / Release / Industry Identifier Code\n" + + "481=ID,1,2,Trace Type Code\n" + + "509=AN,10,10,Originating Company Identifier\n" + + "522=ID,1,3,Amount Qualifier Code\n" + + "584=ID,2,2,Employment Status Code\n" + + "615=ID,1,2,Time Period Qualifier\n" + + "628=AN,1,12,Hierarchical ID Number\n" + + "640=ID,2,2,Transaction Type Code\n" + + "659=ID,1,2,Basis of Verification Code\n" + + "673=ID,2,2,Quantity Qualifier\n" + + "734=AN,1,12,Hierarchical Parent ID Number\n" + + "735=ID,1,12,Hierarchical Level Code\n" + + "736=ID,1,1,Hierarchical Child Code\n" + + "782=R,1,18,Monetary Amount\n" + + "799=AN,1,30,Version Identifier\n" + + "875=ID,3,3,Maintenance Type Code\n" + + "933=AN,1,264,Free-form Message Text\n" + + "934=ID,2,2,Printer Carriage Control Code\n" + + "954=R,1,10,Percent\n" + + "1005=ID,4,4,Hierarchical Structure Code\n" + + "1035=AN,1,60,Name Last or Organization Name\n" + + "1036=AN,1,25,Name First\n" + + "1037=AN,1,25,Name Middle\n" + + "1038=AN,1,10,Name Prefix\n" + + "1039=AN,1,10,Name Suffix\n" + + "1065=ID,1,1,Entity Type Qualifier\n" + + "1066=ID,1,2,Citizenship Status Code\n" + + "1067=ID,1,1,Marital Status Code\n" + + "1068=ID,1,1,Gender Code\n" + + "1069=ID,2,2,Individual Relationship Code\n" + + "1073=ID,1,1,Yes/No Condition or Response Code\n" + + "1109=ID,1,1\n" + + "1136=ID,2,2,Code Category\n" + + "1165=ID,1,1,Confidentiality Code\n" + + "1203=ID,2,3,Maintenance Reason Code\n" + + "1204=AN,1,50,Plan Coverage Description\n" + + "1207=ID,3,3,Coverage Level Code\n" + + "1216=ID,1,1,Benefit Status Code\n" + + "1218=ID,1,1\n" + + "1219=AN,1,2,COBRA\n" + + "1220=ID,1,1,Student Status Code\n" + + "1221=AN,1,3,Provider Code\n" + + "1250=ID,2,3,DateTime Period Format Qualifier\n" + + "1251=AN,1,35,Date Time Period\n" + + "1270=ID,2,3,Code List Qual Code\n" + + "1271=AN,1,30,Industry Code\n" + + "1328=NO,1,2,Diagnosis Code Pointer\n" + + "1336=ID,1,3,Insurance Type Code\n" + + "1339=AN,2,2,Procedure Modifier\n" + + "1365=ID,1,2,Service Type Code\n" + + "1470=NO,1,9,Number\n" + + "1705=AN,1,35,Implementation Convention Reference\n" + + "1715=ID,1,3,Country Subdivision Code\n" + + "11111112=NO,1,9,Interchange Control Number\n" + + "11111116=NO,1,5,Number of Included Functional Groups\n" + + "COMPOSITE ELEMENT DEFINITIONS\n" + + "C003=[235,O][234,O][1339,O][1339,O][1339,O][1339,O][352,O],@@....#\n" + + "C004=[1328,O][1328,O][1328,O][1328,O],@...\n" + + "C022=[1270,O][1271,O][1250,O][1251,O][782,O][380,O][799,O][1271,O][1073,O],@@#######\n" + + "SEGMENT DEFINITIONS\n" + + "AMT=[522][782][478],@@#\n" + + "BHT=[1005,M][353,M][127][373,M][337,M][640]\n" + + "DMG=[1250][1251][1068][1067][1109][1066][26][659][380]+P0102,...######\n" + + "DTP=[374,M][1250,M][1251,M]\n" + + "EQ=[1365][C003][1207][1336][C004]+R0102,..*1.#.*1,..*1##.*1\n" + + "GE=[97,M][28,M]\n" + + "GS=[479,M][142,M][124,M][373,M][337,M][28,M][455,M][480,M]\n" + + "HI=[C022][C022][C022][C022][C022][C022][C022][C022][C022][C022][C022][C022],@*1.*1.*1.*1.*1.*1.*1.*1#*1#*1#*1#*1\n" + + "HL=[628][734][735][736],@#@@,@@@@\n" + + "IEA=[11111116,M][11111112,M]\n" + + "III=[1270,M][1271,M]\n" + + "INS=[1073][1069][875][1203][1216][1218][1219][584][1220][1073][1250][1251][1165][19][156][26][1470],@@##############@,@@##############.\n" + + "ISA=[101,M][102,M][103,M][104,M][105,M][106,M][105,M][107,M][108,M][109,M][165,M][111,M][112,M][113,M][114,M][115,M]\n" + + "MSG=[933][934][1470],@##\n" + + "N3=[166,M][166]\n" + + "N4=[19][156][116][26][309][310][1715],@...##.,....##.,@...##.\n" + + "NM1=[98,M][1065,M][1035][1036][1037][1038][1039][66][67]+P0809,@@...#.@@,@@...#...,@@...#.##,@@@..#.@@\n" + + "PER=[366][93][365][364][365][364][365][364]+P0304P0506P0708,@.......\n" + + "PRV=[1221][128][127],@..\n" + + "REF=[128,M][127,M][352],@@#\n" + + "SE=[96,M][329,M]\n" + + "ST=[143,M][329,M][1705,M]\n" + + "TRN=[481,M][127,M][509,M][127]\n" + + "SEGMENT SELF RULES\n" + + "NM1~2~[EQ]1~4~0\n" + + "NM1~2~[EQ]2~2~4,5\n" + + "COMPOSITE ELEMENT SELF RULES\n" + + "CODELISTS\n" + + "FORMATS\n" + + "Date CCYYMMDD=^(((\\d{4}((0[13578]|1[02])(0[1-9]|[12]\\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\\d|30)|02(0[1-9]|1\\d|2[0-8])))|((\\d{2}[02468][048]|\\d{2}[13579][26]))0229)){0,8}$\n" + + "EDI FILE STRUCTURE\n" + + "{INTERCHANGE HEADER:1[ISA,M]{FUNCTIONAL GROUP:1[GS,M]{ST HEADER:>1[ST,M][BHT,M]{2000A:>1[HL*1,M]{2100A:1[NM1*4,M]}{2000B:>1[HL*2,M]{2100B:1[NM1*4,M][REF,O,9][N3][N4*1][PRV*1]}{2000C:>1[HL*2,M][TRN,O,2]{2100C:1[NM1*2,M][REF*1,O,9][N3][N4*1][PRV*1][DMG*1][INS*1][HI*1][DTP,O,2]{2110C:99[EQ*1][AMT*1][AMT*1][III][REF*1][DTP]}{2000D:>1[HL*2,X][TRN,O,2]{2100D:1[NM1*3,M][REF*1,O,9][N3][N4*3][PRV*1][DMG*1][INS*2][HI*1][DTP,O,2]{2110D:99[EQ*2,M][III][REF*1][DTP]}}}}}}}{END ST HEADER LOOP:1[SE,M]}}{END GS LOOP:1[GE,M]}}{END ISA LOOP:1[IEA,M]}}\n" + + "ELEMENT CODES\n" + + "101=1:1,00,03\n" + + "103=1:3,00,01\n" + + "105=1:5,01,14,20,27,28,29,30,33,ZZ*1:7,01,14,20,27,28,29,30,33,ZZ\n" + + "111=1:12,00501\n" + + "113=1:14,0,1\n" + + "114=1:15,P,T\n" + + "479=2:1,HS\n" + + "455=2:7,X\n" + + "480=2:8,005010X279A1\n" + + "143=3:1,270\n" + + "1705=3:3,005010X279A1\n" + + "1005=4:1,0022\n" + + "353=4:2,01,13\n" + + "640=4:6,RT\n" + + "735=5:3,20*7:3,21*13:3,22*30:3,23\n" + + "736=5:4,1*7:4,1*13:4,0,1*30:4,0\n" + + "98=6:1,2B,36,GP,P5,PR*8:1,1P,2B,36,80,FA,GP,P5,PR*15:1,IL*32:1,03\n" + + "1065=6:2,1,2*8:2,1,2*15:2,1,2*32:2,1\n" + + "66=6:8,24,46,FI,NI,PI,XV,XX*8:8,24,34,FI,PI,PP,SV,XV,XX*15:8,II,MI\n" + + "128=9:1,0B,1C,1D,1J,4A,CT,EL,EO,HPI,JD,N5,N7,Q4,SY,TJ*12:2,PXC*16:1,18,1L,1W,3H,6P,CT,EA,EJ,F6,GH,HJ,IG,N6,NQ,SY,Y4*19:2,9K,D3,EI,HPI,PXC,SY,TJ*28:1,9F,G1*33:1,18,1L,1W,6P,CT,EA,EJ,F6,GH,HJ,IF,IG,MRC,N6,SY,Y4*36:2,9K,D3,EI,HPI,PXC,SY,TJ*43:1,9F,G1\n" + + "1221=12:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SB,SK,SU*19:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU*36:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU\n" + + "481=14:1,1*31:1,1\n" + + "1250=20:1,D8*23:2,D8,RD8*29:2,D8,RD8*37:1,D8*40:2,D8,RD8*44:2,D8,RD8\n" + + "1068=20:3,F,M*37:3,F,M\n" + + "1073=21:1,Y*38:1,N\n" + + "1069=21:2,18*38:2,01,19,34\n" + + "1270=22:1:1,ABK,BK*22:2:1,ABF,BF*22:3:1,ABF,BF*22:4:1,ABF,BF*22:5:1,ABF,BF*22:6:1,ABF,BF*22:7:1,ABF,BF*22:8:1,ABF,BF*27:1,ZZ*39:1:1,ABK,BK*39:2:1,ABF,BF*39:3:1,ABF,BF*39:4:1,ABF,BF*39:5:1,ABF,BF*39:6:1,ABF,BF*39:7:1,ABF,BF*39:8:1,ABF,BF*42:1,BF,BK,ZZ\n" + + "374=23:1,102,291*29:1,291*40:1,102,291*44:1,291\n" + + "1365=24:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,B1,B2,B3,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,C1,CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM,CN,CO,CP,CQ,DG,DM,DS,GF,GN,GY,IC,MH,NI,ON,PT,PU,RN,RT,TC,TN,UC*41:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS\n" + + "235=24:2:1,AD,CJ,HC,ID,IV,N4,ZZ*41:2:1,AD,CJ,HC,ID,IV,N4,ZZ\n" + + "1207=24:3,FAM*41:3,CHD,DEP,ECH,EMP,ESP,FAM,IND,SPC,SPO\n" + + "522=25:1,R*26:1,PB\n" + + "1336=41:4,AP,C1,CO,HM,IP,OT,PR,PS,SP,WC\n" + + "ELEMENT FORMATS\n" + + "1251=20:2,0,,Date CCYYMMDD\n" + + "SUMMARY\n" + + "ELEMENT EQUALITY\n" + + "1:13=47:2\n" + + "3:2=45:2\n" + + "RULES\n" + + "24=13:4'EQ'0!USAGE!2!1\n" + + "30=13:4'EQ'1!USAGE!2!1\n" + + "ELEMENT COUNTERS\n" + + "ELEMENT CODE DESCRIPTION\n" + + "LOOP DESCRIPTIONS\n" + + "INTERCHANGE HEADER=START OF INTERCHANGE HEADER\n" + + "FUNCTIONAL GROUP=START OF FUNCTIONAL GROUP\n" + + "ST HEADER=START OF ST HEADER\n" + + "2000A=INFORMATION SOURCE LEVEL\n" + + "2100A=INFORMATION SOURCE NAME\n" + + "2000B=INFORMATION RECEIVER LEVEL\n" + + "2100B=INFORMATION RECEIVER NAME\n" + + "2000C=SUBSCRIBER LEVEL\n" + + "2100C=SUBSCRIBER NAME\n" + + "2110C=SUBSCRIBER ELIGIBILITY OR BENEFIT INQUIRY\n" + + "2000D=DEPENDENT LEVEL\n" + + "2100D=DEPENDENT NAME\n" + + "2110D=DEPENDENT ELIGIBILITY OR BENEFIT INQUIRY\n" + + "END ST HEADER LOOP=END ST HEADER LOOP\n" + + "END GS LOOP=END OF FUNCTIONAL HEADER\n" + + "END ISA LOOP=END OF INTERCHANGE HEADER\n" + + "SEGMENT DESCRIPTIONS\n" + + "ISA=1,Interchange Header\n" + + "GS=2,Functional Group\n" + + "ST=3,Transaction Set Header\n" + + "BHT=4,Beginning of Hierarchical Transaction\n" + + "HL=5,Information Source Level\n" + + "NM1=6,Information Source Name\n" + + "HL=7,Information Receiver Level\n" + + "NM1=8,Information Receiver Name\n" + + "REF=9,Information Receiver Additional Identification\n" + + "N3=10,Information Receiver Address\n" + + "N4=11,Information Receiver City\n" + + "PRV=12,Information Receiver Provider Information\n" + + "HL=13,Subscriber Level\n" + + "TRN=14,Subscriber Trace Number\n" + + "NM1=15,Subscriber Name\n" + + "REF=16,Subscriber Additional Identification\n" + + "N3=17,Subscriber Address\n" + + "N4=18,Subscriber City\n" + + "PRV=19,Provider Information\n" + + "DMG=20,Subscriber Demographic Information\n" + + "INS=21,Multiple Birth Sequence Number\n" + + "HI=22,Subscriber Health Care Diagnosis Code\n" + + "DTP=23,Subscriber Date\n" + + "EQ=24,Subscriber Eligibility or Benefit Inquiry\n" + + "AMT=25,Subscriber Spend Down Amount\n" + + "AMT=26,Subscriber Spend Down Total Billed Amount\n" + + "III=27,Subscriber Eligibility or Benefit Additional Inquiry Information\n" + + "REF=28,Subscriber Additional Information\n" + + "DTP=29,Subscriber Eligibility/Benefit Date\n" + + "HL=30,Dependent Level\n" + + "TRN=31,Dependent Trace Number\n" + + "NM1=32,Dependent Name\n" + + "REF=33,Dependent Additional Identification\n" + + "N3=34,Dependent Address\n" + + "N4=35,Dependent City\n" + + "PRV=36,Provider Information\n" + + "DMG=37,Dependent Demographic Information\n" + + "INS=38,Dependent Relationship\n" + + "HI=39,Dependent Health Care Diagnosis Code\n" + + "DTP=40,Dependent Date\n" + + "EQ=41,Dependent Eligibility or Benefit Inquiry\n" + + "III=42,Dependent Eligibility or Benefit Additional Inquiry Information\n" + + "REF=43,Dependent Additional Information\n" + + "DTP=44,Dependent Eligibility/Benefit Date\n" + + "SAMPLE DATA"; diff --git a/test_harness/generateacknowledgement/enummap.js b/test_harness/generateacknowledgement/enummap.js index 9c5cf2c..79f224c 100644 --- a/test_harness/generateacknowledgement/enummap.js +++ b/test_harness/generateacknowledgement/enummap.js @@ -1,66 +1,67 @@ -//Other validation rules files are located in the RDPCrystalInstallation\Validation Rules directory +// Other validation rules files are located in the +// RDPCrystalInstallation\Validation Rules directory function EnumMap() { this.SnipLevelTypes = { - 0: "DoesNotApply", - 1: "Integrity", - 2: "Requirement", - 3: "Balance", - 4: "Situational", - 5: "CodeSet", + 0 : "DoesNotApply", + 1 : "Integrity", + 2 : "Requirement", + 3 : "Balance", + 4 : "Situational", + 5 : "CodeSet", }; this.MessageTypes = { - 0: "None", - 1: "CompositeElementMissing", - 2: "CompositeElementDataFormatInvalid", - 3: "CompositeElementNotUsed", - 4: "CompositeElementRecommended", - 5: "CompositeElementNotRecommended", - 6: "CompositeElementLessThanMinimumLength", - 7: "CompositeElementGreaterThanMaximumLength", - 8: "CompositeElementHasWrongValue", - 9: "CompositeElementValueAlreadyEntered", - 10: "DuplicateSegment", - 11: "DuplicateLoop", - 12: "ElementHasWrongValue", - 13: "InternalElementHasWrongValue", - 14: "ElementLessThanMinimumLength", - 15: "ElementGreaterThanMaximumLength", - 16: "ElementValueAlreadyEntered", - 17: "ElementDataFormatInvalid", - 18: "ElementNotUsed", - 19: "ElementRecommended", - 20: "ElementNotRecommended", - 21: "ElementMissing", - 22: "EmptyTrailingElements", - 23: "EmptyTrailingCompositeElement", - 24: "ExtraElementFound", - 25: "ExtraCompositeElementFound", - 26: "ExtraDataAtEndOfFile", - 27: "LoopMissing", - 28: "LoopNotUsed", - 29: "LoopNotRecommended", - 30: "LoopRecommended", - 31: "MalformedSegment", - 32: "InvalidIntegerValue", - 33: "InvalidDateValue", - 34: "InvalidTimeValue", - 35: "InvalidAlphabeticValue", - 36: "InvalidPositiveNumberValue", - 37: "InvalidNegativeNumberValue", - 38: "InvalidDecimalValue", - 39: "SegmentNotRecommended", - 40: "SegmentNotUsed", - 41: "SegmentNotInDictionary", - 42: "SegmentRecommended", - 43: "SegmentMissing", - 44: "SummaryValueMismatch", - 45: "UnrecognizedLoop", - 46: "UnrecognizedSegment", - 47: "IllegalCharactorInFile", - 48: "MalformedEDIFile", - 49: "MaximumErrorLimitReached", - 50: "UnexpectedError", + 0 : "None", + 1 : "CompositeElementMissing", + 2 : "CompositeElementDataFormatInvalid", + 3 : "CompositeElementNotUsed", + 4 : "CompositeElementRecommended", + 5 : "CompositeElementNotRecommended", + 6 : "CompositeElementLessThanMinimumLength", + 7 : "CompositeElementGreaterThanMaximumLength", + 8 : "CompositeElementHasWrongValue", + 9 : "CompositeElementValueAlreadyEntered", + 10 : "DuplicateSegment", + 11 : "DuplicateLoop", + 12 : "ElementHasWrongValue", + 13 : "InternalElementHasWrongValue", + 14 : "ElementLessThanMinimumLength", + 15 : "ElementGreaterThanMaximumLength", + 16 : "ElementValueAlreadyEntered", + 17 : "ElementDataFormatInvalid", + 18 : "ElementNotUsed", + 19 : "ElementRecommended", + 20 : "ElementNotRecommended", + 21 : "ElementMissing", + 22 : "EmptyTrailingElements", + 23 : "EmptyTrailingCompositeElement", + 24 : "ExtraElementFound", + 25 : "ExtraCompositeElementFound", + 26 : "ExtraDataAtEndOfFile", + 27 : "LoopMissing", + 28 : "LoopNotUsed", + 29 : "LoopNotRecommended", + 30 : "LoopRecommended", + 31 : "MalformedSegment", + 32 : "InvalidIntegerValue", + 33 : "InvalidDateValue", + 34 : "InvalidTimeValue", + 35 : "InvalidAlphabeticValue", + 36 : "InvalidPositiveNumberValue", + 37 : "InvalidNegativeNumberValue", + 38 : "InvalidDecimalValue", + 39 : "SegmentNotRecommended", + 40 : "SegmentNotUsed", + 41 : "SegmentNotInDictionary", + 42 : "SegmentRecommended", + 43 : "SegmentMissing", + 44 : "SummaryValueMismatch", + 45 : "UnrecognizedLoop", + 46 : "UnrecognizedSegment", + 47 : "IllegalCharactorInFile", + 48 : "MalformedEDIFile", + 49 : "MaximumErrorLimitReached", + 50 : "UnexpectedError", }; } diff --git a/test_harness/generateacknowledgement/index.js b/test_harness/generateacknowledgement/index.js index 00ab71c..880f7ae 100644 --- a/test_harness/generateacknowledgement/index.js +++ b/test_harness/generateacknowledgement/index.js @@ -5,65 +5,66 @@ const enumMap = require("./enummap"); let map = new enumMap(); -//Create a new validator +// Create a new validator let validator = new edi.EDIValidator(); -//While validating also load the data in memory +// While validating also load the data in memory validator.LoadValidatedData = true; -//Load a 5010 270 validation rules -let validationRules = fs - .readFileSync("../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") - .toString(); +// Load a 5010 270 validation rules +let validationRules = + fs.readFileSync( + "../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") + .toString(); validator.EDIRulesFileData = validationRules; -//Set the EDI data to validate and load. This can also be read in from a file +// Set the EDI data to validate and load. This can also be read in from a file validator.EDIDataString = - "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + - "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + - "ST*271*1234*005010X279A1~" + - "BHT*0022*13*10001234*20060501*1319~" + - "HL*1**20*1~" + - "NM1*PR*2*ABC COMPANY*****PI*842610001~" + - "HL*2*1*21*1~" + - "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + - "HL*3*2*22*0~" + - "TRN*1*93175-012547*9877281234~" + - "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + - "DMG*D8*19430519~" + - "DTP*291*D8*20060501~" + - "EQ*30~" + - "SE*13*1234~" + - "GE*1*1~" + - "IEA*1*000000905~"; + "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + + "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + + "ST*271*1234*005010X279A1~" + + "BHT*0022*13*10001234*20060501*1319~" + + "HL*1**20*1~" + + "NM1*PR*2*ABC COMPANY*****PI*842610001~" + + "HL*2*1*21*1~" + + "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + + "HL*3*2*22*0~" + + "TRN*1*93175-012547*9877281234~" + + "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + + "DMG*D8*19430519~" + + "DTP*291*D8*20060501~" + + "EQ*30~" + + "SE*13*1234~" + + "GE*1*1~" + + "IEA*1*000000905~"; console.log("Validating 5010 271 EDI Files"); validator.validate(); console.log("Errors Found->"); -//Get all errors from the EDI data +// Get all errors from the EDI data for (let i = 0; i < validator.Errors.Count; i++) { let error = validator.Errors.getItem(i); console.log({ - Type: "Error", - Line: error.LineNumber, - Transaction: "", - SnipLevel: map.SnipLevelTypes[error.SnipLevel], - Message: map.MessageTypes[error.Message], - Loop: error.Loop, - Segment: error.Segment, - Element: error.ElementOrdinal, - Composite: error.CompositeElementOrdinal, - Description: error.Description, - Ordinal: error.SegmentOrdinal, + Type : "Error", + Line : error.LineNumber, + Transaction : "", + SnipLevel : map.SnipLevelTypes[error.SnipLevel], + Message : map.MessageTypes[error.Message], + Loop : error.Loop, + Segment : error.Segment, + Element : error.ElementOrdinal, + Composite : error.CompositeElementOrdinal, + Description : error.Description, + Ordinal : error.SegmentOrdinal, }); } console.log("Generated 5010 999 Acknowledgment File"); -//Generate 5010 999 Acknowledgment File +// Generate 5010 999 Acknowledgment File let ack999Generator = new edi.Ack999Generator(); let ackDocument = ack999Generator.generate(validator); diff --git a/test_harness/validatedocument/enummap.js b/test_harness/validatedocument/enummap.js index 9c5cf2c..79f224c 100644 --- a/test_harness/validatedocument/enummap.js +++ b/test_harness/validatedocument/enummap.js @@ -1,66 +1,67 @@ -//Other validation rules files are located in the RDPCrystalInstallation\Validation Rules directory +// Other validation rules files are located in the +// RDPCrystalInstallation\Validation Rules directory function EnumMap() { this.SnipLevelTypes = { - 0: "DoesNotApply", - 1: "Integrity", - 2: "Requirement", - 3: "Balance", - 4: "Situational", - 5: "CodeSet", + 0 : "DoesNotApply", + 1 : "Integrity", + 2 : "Requirement", + 3 : "Balance", + 4 : "Situational", + 5 : "CodeSet", }; this.MessageTypes = { - 0: "None", - 1: "CompositeElementMissing", - 2: "CompositeElementDataFormatInvalid", - 3: "CompositeElementNotUsed", - 4: "CompositeElementRecommended", - 5: "CompositeElementNotRecommended", - 6: "CompositeElementLessThanMinimumLength", - 7: "CompositeElementGreaterThanMaximumLength", - 8: "CompositeElementHasWrongValue", - 9: "CompositeElementValueAlreadyEntered", - 10: "DuplicateSegment", - 11: "DuplicateLoop", - 12: "ElementHasWrongValue", - 13: "InternalElementHasWrongValue", - 14: "ElementLessThanMinimumLength", - 15: "ElementGreaterThanMaximumLength", - 16: "ElementValueAlreadyEntered", - 17: "ElementDataFormatInvalid", - 18: "ElementNotUsed", - 19: "ElementRecommended", - 20: "ElementNotRecommended", - 21: "ElementMissing", - 22: "EmptyTrailingElements", - 23: "EmptyTrailingCompositeElement", - 24: "ExtraElementFound", - 25: "ExtraCompositeElementFound", - 26: "ExtraDataAtEndOfFile", - 27: "LoopMissing", - 28: "LoopNotUsed", - 29: "LoopNotRecommended", - 30: "LoopRecommended", - 31: "MalformedSegment", - 32: "InvalidIntegerValue", - 33: "InvalidDateValue", - 34: "InvalidTimeValue", - 35: "InvalidAlphabeticValue", - 36: "InvalidPositiveNumberValue", - 37: "InvalidNegativeNumberValue", - 38: "InvalidDecimalValue", - 39: "SegmentNotRecommended", - 40: "SegmentNotUsed", - 41: "SegmentNotInDictionary", - 42: "SegmentRecommended", - 43: "SegmentMissing", - 44: "SummaryValueMismatch", - 45: "UnrecognizedLoop", - 46: "UnrecognizedSegment", - 47: "IllegalCharactorInFile", - 48: "MalformedEDIFile", - 49: "MaximumErrorLimitReached", - 50: "UnexpectedError", + 0 : "None", + 1 : "CompositeElementMissing", + 2 : "CompositeElementDataFormatInvalid", + 3 : "CompositeElementNotUsed", + 4 : "CompositeElementRecommended", + 5 : "CompositeElementNotRecommended", + 6 : "CompositeElementLessThanMinimumLength", + 7 : "CompositeElementGreaterThanMaximumLength", + 8 : "CompositeElementHasWrongValue", + 9 : "CompositeElementValueAlreadyEntered", + 10 : "DuplicateSegment", + 11 : "DuplicateLoop", + 12 : "ElementHasWrongValue", + 13 : "InternalElementHasWrongValue", + 14 : "ElementLessThanMinimumLength", + 15 : "ElementGreaterThanMaximumLength", + 16 : "ElementValueAlreadyEntered", + 17 : "ElementDataFormatInvalid", + 18 : "ElementNotUsed", + 19 : "ElementRecommended", + 20 : "ElementNotRecommended", + 21 : "ElementMissing", + 22 : "EmptyTrailingElements", + 23 : "EmptyTrailingCompositeElement", + 24 : "ExtraElementFound", + 25 : "ExtraCompositeElementFound", + 26 : "ExtraDataAtEndOfFile", + 27 : "LoopMissing", + 28 : "LoopNotUsed", + 29 : "LoopNotRecommended", + 30 : "LoopRecommended", + 31 : "MalformedSegment", + 32 : "InvalidIntegerValue", + 33 : "InvalidDateValue", + 34 : "InvalidTimeValue", + 35 : "InvalidAlphabeticValue", + 36 : "InvalidPositiveNumberValue", + 37 : "InvalidNegativeNumberValue", + 38 : "InvalidDecimalValue", + 39 : "SegmentNotRecommended", + 40 : "SegmentNotUsed", + 41 : "SegmentNotInDictionary", + 42 : "SegmentRecommended", + 43 : "SegmentMissing", + 44 : "SummaryValueMismatch", + 45 : "UnrecognizedLoop", + 46 : "UnrecognizedSegment", + 47 : "IllegalCharactorInFile", + 48 : "MalformedEDIFile", + 49 : "MaximumErrorLimitReached", + 50 : "UnexpectedError", }; } diff --git a/test_harness/validatedocument/index.js b/test_harness/validatedocument/index.js index b5de1b2..db8e84b 100644 --- a/test_harness/validatedocument/index.js +++ b/test_harness/validatedocument/index.js @@ -5,58 +5,59 @@ const enumMap = require("./enummap"); let map = new enumMap(); -//Create a new validator +// Create a new validator let validator = new edi.EDIValidator(); -//While validating also load the data in memory +// While validating also load the data in memory validator.LoadValidatedData = true; -//Load a 5010 270 validation rules -let validationRules = fs - .readFileSync("../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") - .toString(); +// Load a 5010 270 validation rules +let validationRules = + fs.readFileSync( + "../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") + .toString(); validator.EDIRulesFileData = validationRules; -//Set the EDI data to validate and load. This can also be read in from a file +// Set the EDI data to validate and load. This can also be read in from a file validator.EDIDataString = - "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + - "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + - "ST*271*1234*005010X279A1~" + - "BHT*0022*13*10001234*20060501*1319~" + - "HL*1**20*1~" + - "NM1*PR*2*ABC COMPANY*****PI*842610001~" + - "HL*2*1*21*1~" + - "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + - "HL*3*2*22*0~" + - "TRN*1*93175-012547*9877281234~" + - "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + - "DMG*D8*19430519~" + - "DTP*291*D8*20060501~" + - "EQ*30~" + - "SE*13*1234~" + - "GE*1*1~" + - "IEA*1*000000905~"; + "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + + "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + + "ST*271*1234*005010X279A1~" + + "BHT*0022*13*10001234*20060501*1319~" + + "HL*1**20*1~" + + "NM1*PR*2*ABC COMPANY*****PI*842610001~" + + "HL*2*1*21*1~" + + "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + + "HL*3*2*22*0~" + + "TRN*1*93175-012547*9877281234~" + + "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + + "DMG*D8*19430519~" + + "DTP*291*D8*20060501~" + + "EQ*30~" + + "SE*13*1234~" + + "GE*1*1~" + + "IEA*1*000000905~"; console.log("Validating 5010 271 EDI Files"); validator.validate(); console.log("Errors Found"); -//Get all errors from the EDI data +// Get all errors from the EDI data for (let i = 0; i < validator.Errors.Count; i++) { let error = validator.Errors.getItem(i); console.log({ - Type: "Error", - Line: error.LineNumber, - Transaction: "", - SnipLevel: map.SnipLevelTypes[error.SnipLevel], //SnipTestLevel Enum - Message: map.MessageTypes[error.Message], //EDIValidationMessage Enum - Loop: error.Loop, - Segment: error.Segment, - Element: error.ElementOrdinal, - Composite: error.CompositeElementOrdinal, - Description: error.Description, - Ordinal: error.SegmentOrdinal, + Type : "Error", + Line : error.LineNumber, + Transaction : "", + SnipLevel : map.SnipLevelTypes[error.SnipLevel], // SnipTestLevel Enum + Message : map.MessageTypes[error.Message], // EDIValidationMessage Enum + Loop : error.Loop, + Segment : error.Segment, + Element : error.ElementOrdinal, + Composite : error.CompositeElementOrdinal, + Description : error.Description, + Ordinal : error.SegmentOrdinal, }); } diff --git a/test_harness/x12_test_harness/group.js b/test_harness/x12_test_harness/group.js index 74e0ed0..b7e504f 100644 --- a/test_harness/x12_test_harness/group.js +++ b/test_harness/x12_test_harness/group.js @@ -6,90 +6,90 @@ const { groupedByISA, } = require("./testFiles/835/profee-done"); -describe("Group", function () { +describe("Group", function() { const clp = { - "1": "PATIENT ACCOUNT NUMBER", - "2": "1", - "3": "34.25", - "4": "34.25", - "5": "", - "6": "MC", - "7": "1000210000000030", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "1", + "3" : "34.25", + "4" : "34.25", + "5" : "", + "6" : "MC", + "7" : "1000210000000030", + "8" : "11", + name : "CLP", }; const svcArray = [ { - "1": "HC", - "2": "6", - "3": "6", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2020", - "1-2": "RB", + "1" : "HC", + "2" : "6", + "3" : "6", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2020", + "1-2" : "RB", }, - { "1": "472", "2": "20100101", name: "DTM" }, - { "1": "B6", "2": "6", name: "AMT" }, + {"1" : "472", "2" : "20100101", name : "DTM"}, + {"1" : "B6", "2" : "6", name : "AMT"}, { - "1": "HC", - "2": "2.75", - "3": "2.75", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2700", - "1-2": "RB", + "1" : "HC", + "2" : "2.75", + "3" : "2.75", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2700", + "1-2" : "RB", }, - { "1": "472", "2": "20100101", name: "DTM" }, - { "1": "B6", "2": "2.75", name: "AMT" }, + {"1" : "472", "2" : "20100101", name : "DTM"}, + {"1" : "B6", "2" : "2.75", name : "AMT"}, ]; const grouped = { - name: "2100", - data: [ + name : "2100", + data : [ { - "1": "PATIENT ACCOUNT NUMBER", - "2": "1", - "3": "34.25", - "4": "34.25", - "5": "", - "6": "MC", - "7": "1000210000000030", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "1", + "3" : "34.25", + "4" : "34.25", + "5" : "", + "6" : "MC", + "7" : "1000210000000030", + "8" : "11", + name : "CLP", }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "6", - "3": "6", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2020", - "1-2": "RB", + "1" : "HC", + "2" : "6", + "3" : "6", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2020", + "1-2" : "RB", }, - { "1": "472", "2": "20100101", name: "DTM" }, - { "1": "B6", "2": "6", name: "AMT" }, + {"1" : "472", "2" : "20100101", name : "DTM"}, + {"1" : "B6", "2" : "6", name : "AMT"}, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "2.75", - "3": "2.75", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2700", - "1-2": "RB", + "1" : "HC", + "2" : "2.75", + "3" : "2.75", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2700", + "1-2" : "RB", }, - { "1": "472", "2": "20100101", name: "DTM" }, - { "1": "B6", "2": "2.75", name: "AMT" }, + {"1" : "472", "2" : "20100101", name : "DTM"}, + {"1" : "B6", "2" : "2.75", name : "AMT"}, ], }, ], @@ -97,80 +97,80 @@ describe("Group", function () { // ! This was written assuming multi-root groups, which is not yet supported. const schema = { - version: "005010X221A1", // What version of the transaction set this applies to - start: "ST", // What segment starts the group - name: "Transaction", // What is the name of the group - end: "SE", // Closes all nested groups when this is detected - groups: [ + version : + "005010X221A1", // What version of the transaction set this applies to + start : "ST", // What segment starts the group + name : "Transaction", // What is the name of the group + end : "SE", // Closes all nested groups when this is detected + groups : [ // An array of groups to create { - start: "N1", // What segment starts the group - end: null, // What segment ends the group - name: "1000", // What is the name of the group - terminators: ["N1", "LX"], - groups: [ + start : "N1", // What segment starts the group + end : null, // What segment ends the group + name : "1000", // What is the name of the group + terminators : [ "N1", "LX" ], + groups : [ // Nested groups { - start: "N1", - end: null, - name: "1000B", + start : "N1", + end : null, + name : "1000B", }, ], - }, // -- At this point group 1000A would be pushed down the data stream before starting loop 2000 + }, // -- At this point group 1000A would be pushed down the data stream + // before starting loop 2000 { - start: "CLP", - end: null, - name: "2100", - terminators: ["CLP"], - groups: [ + start : "CLP", + end : null, + name : "2100", + terminators : [ "CLP" ], + groups : [ { - start: "SVC", - end: null, - name: "2110", + start : "SVC", + end : null, + name : "2110", }, ], }, ], }; - describe("#constructor()", function () { - it("Should return an instance of group", function () { + describe("#constructor()", function() { + it("Should return an instance of group", function() { const myGroup = new Group(schema.groups[1], clp, () => {}); assert(myGroup instanceof Group); }); }); - describe("#terminate()", function () { - it("Should execute cb with grouped data", function () { + describe("#terminate()", function() { + it("Should execute cb with grouped data", function() { const callDone = (group) => { assert(group instanceof Group); assert.deepStrictEqual(group.data, { - name: "2100", - data: [{ ...clp }], + name : "2100", + data : [ {...clp} ], }); }; const myGroup = new Group(schema.groups[1], clp, callDone); myGroup.terminate(); }); }); - describe("#add()", function () { - it("Should group nested data", function () { - const callDone = (group) => { - assert.deepStrictEqual(group.data, grouped); - }; + describe("#add()", function() { + it("Should group nested data", function() { + const callDone = + (group) => { assert.deepStrictEqual(group.data, grouped); }; const myGroup = new Group(schema.groups[1], clp, callDone); - svcArray.forEach((svc) => { - assert.strictEqual(myGroup.add(svc), true); - }); + svcArray.forEach( + (svc) => { assert.strictEqual(myGroup.add(svc), true); }); myGroup.terminate(); }); - it("Should be able to group multiple nested groups", function () { - const callDone = (group) => { - assert.deepStrictEqual(group.data, groupedByISA); - }; + it("Should be able to group multiple nested groups", function() { + const callDone = + (group) => { assert.deepStrictEqual(group.data, groupedByISA); }; const myGroup = new Group(groupedByISAschema, finished[0], callDone); finished.forEach((item, index) => { - //Skip first index / ISA - if (index === 0) return; + // Skip first index / ISA + if (index === 0) + return; myGroup.add(item); }); diff --git a/test_harness/x12_test_harness/schema.js b/test_harness/x12_test_harness/schema.js index 96ebcda..3f38ae0 100644 --- a/test_harness/x12_test_harness/schema.js +++ b/test_harness/x12_test_harness/schema.js @@ -1,44 +1,40 @@ -const { Schema } = require("../index"); +const {Schema} = require("../index"); const assert = require("assert"); const schema = { - start: "CLP", // What segment starts the group - terminators: ["SE"], // What segment ends the group - name: "2100", // What is the name of the group - groups: [ + start : "CLP", // What segment starts the group + terminators : [ "SE" ], // What segment ends the group + name : "2100", // What is the name of the group + groups : [ // Nested groups { - start: "SVC", - name: "2110", + start : "SVC", + name : "2110", }, ], }; -describe("Schema", function () { - describe("#constructor()", function () { +describe("Schema", function() { + describe("#constructor()", function() { const testSchema = new Schema("005010X221A1", schema, true); - it("Should return an instance of Schema", function () { - assert(testSchema instanceof Schema); - }); - it("Should be able to get version", function () { - assert.strictEqual(testSchema.version, "005010X221A1"); - }); - it("Should be able to get schema", function () { - assert.deepStrictEqual(testSchema.schema, schema); - }); - it("Should be able to get default", function () { - assert.strictEqual(testSchema.default, true); - }); + it("Should return an instance of Schema", + function() { assert(testSchema instanceof Schema); }); + it("Should be able to get version", + function() { assert.strictEqual(testSchema.version, "005010X221A1"); }); + it("Should be able to get schema", + function() { assert.deepStrictEqual(testSchema.schema, schema); }); + it("Should be able to get default", + function() { assert.strictEqual(testSchema.default, true); }); }); - describe("#verifySchema()", function () { - it("Should return the schema if valid", function () { + describe("#verifySchema()", function() { + it("Should return the schema if valid", function() { assert.deepStrictEqual(Schema.verifySchema(schema), schema); }); - it("Should require a start of the group", function () { + it("Should require a start of the group", function() { assert.throws(() => Schema.verifySchema("garbage", Error)); }); - it("Should verify all nested groups have a start", function () { - const testSchema = { ...schema }; + it("Should verify all nested groups have a start", function() { + const testSchema = {...schema}; delete testSchema.groups[0].start; assert.throws(() => Schema.verifySchema(testSchema, Error)); }); diff --git a/test_harness/x12_test_harness/segment.js b/test_harness/x12_test_harness/segment.js index ad308f6..d7a8e5d 100644 --- a/test_harness/x12_test_harness/segment.js +++ b/test_harness/x12_test_harness/segment.js @@ -1,55 +1,56 @@ const Segment = require("../lib/Segment"); const assert = require("assert"); -describe("Segment", function () { +describe("Segment", function() { const delimiters = { - segment: "~", - element: "*", - component: ":", - repetition: "^", + segment : "~", + element : "*", + component : ":", + repetition : "^", }; - describe("#cleanString()", function () { - it("Should remove white space & remove new lines", function () { + describe("#cleanString()", function() { + it("Should remove white space & remove new lines", function() { // CRLF is already replace in X12 class assert.deepEqual(Segment.cleanString(" test \n "), "test"); }); }); - describe("#processElement()", function () { - it("Should return an array of strings, split by the component delimiter", function () { - //TODO: Remove initial segment when type checking is added - const mySegment = new Segment("AMT*AU*34.25", delimiters); - assert.deepEqual(mySegment.processElement("AU"), ["AU"]); - }); - it("If ISA component is left in tact, since it is an actual element", function () { - //TODO: Remove initial segment when type checking is added - const isa = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; - const mySegment = new Segment(isa, delimiters); - assert.deepEqual(mySegment.processElement(":"), [":"]); - }); + describe("#processElement()", function() { + it("Should return an array of strings, split by the component delimiter", + function() { + // TODO: Remove initial segment when type checking is added + const mySegment = new Segment("AMT*AU*34.25", delimiters); + assert.deepEqual(mySegment.processElement("AU"), [ "AU" ]); + }); + it("If ISA component is left in tact, since it is an actual element", + function() { + // TODO: Remove initial segment when type checking is added + const isa = + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; + const mySegment = new Segment(isa, delimiters); + assert.deepEqual(mySegment.processElement(":"), [ ":" ]); + }); }); - // Class immediatly calls parse, so constructor test was moved below the other method tests - // To be changed in future update when type testing is added to segment class - describe("#constructor()", function () { + // Class immediatly calls parse, so constructor test was moved below the other + // method tests To be changed in future update when type testing is added to + // segment class + describe("#constructor()", function() { const mySegment = new Segment("AMT*AU*34.25", delimiters); - it("Should return a Segment", function () { - assert(mySegment instanceof Segment); - }); - it("Should parse passed raw element string", function () { - assert.deepEqual(mySegment.parsed, [["AU"], ["34.25"]]); - }); - it("Should parse out the name of the element", function () { - assert.strictEqual(mySegment.name, "AMT"); + it("Should return a Segment", + function() { assert(mySegment instanceof Segment); }); + it("Should parse passed raw element string", function() { + assert.deepEqual(mySegment.parsed, [ [ "AU" ], [ "34.25" ] ]); }); + it("Should parse out the name of the element", + function() { assert.strictEqual(mySegment.name, "AMT"); }); }); - describe("formatted", function () { + describe("formatted", function() { const mySegment = new Segment("AMT*AU*34.25", delimiters); - it("Should return an object of elements", function () { + it("Should return an object of elements", function() { assert.deepEqual(mySegment.formatted, { - name: "AMT", - "1": "AU", - "2": "34.25", + name : "AMT", + "1" : "AU", + "2" : "34.25", }); }); }); diff --git a/test_harness/x12_test_harness/testFiles/835/profee-done.js b/test_harness/x12_test_harness/testFiles/835/profee-done.js index ef1404e..610fafd 100644 --- a/test_harness/x12_test_harness/testFiles/835/profee-done.js +++ b/test_harness/x12_test_harness/testFiles/835/profee-done.js @@ -1,1026 +1,1026 @@ exports.finished = [ { - "1": "00", - "2": "", - "3": "00", - "4": "", - "5": "ZZ", - "6": "EMEDNYBAT", - "7": "ZZ", - "8": "ETIN", - "9": "100101", - "10": "1000", - "11": "^", - "12": "00501", - "13": "006000600", - "14": "0", - "15": "T", - "16": ":", - name: "ISA", - }, - { - "1": "HP", - "2": "EMEDNYBAT", - "3": "ETIN", - "4": "20100101", - "5": "1050", - "6": "6000600", - "7": "X", - "8": "005010X221A1", - name: "GS", - }, - { - "1": "835", - "2": "1740", - name: "ST", - }, - { - "1": "I", - "2": "45.75", - "3": "C", - "4": "ACH", - "5": "CCP", - "6": "01", - "7": "111", - "8": "DA", - "9": "33", - "10": "1234567890", - "11": "", - "12": "01", - "13": "111", - "14": "DA", - "15": "22", - "16": "20100101", - name: "BPR", + "1" : "00", + "2" : "", + "3" : "00", + "4" : "", + "5" : "ZZ", + "6" : "EMEDNYBAT", + "7" : "ZZ", + "8" : "ETIN", + "9" : "100101", + "10" : "1000", + "11" : "^", + "12" : "00501", + "13" : "006000600", + "14" : "0", + "15" : "T", + "16" : ":", + name : "ISA", + }, + { + "1" : "HP", + "2" : "EMEDNYBAT", + "3" : "ETIN", + "4" : "20100101", + "5" : "1050", + "6" : "6000600", + "7" : "X", + "8" : "005010X221A1", + name : "GS", + }, + { + "1" : "835", + "2" : "1740", + name : "ST", + }, + { + "1" : "I", + "2" : "45.75", + "3" : "C", + "4" : "ACH", + "5" : "CCP", + "6" : "01", + "7" : "111", + "8" : "DA", + "9" : "33", + "10" : "1234567890", + "11" : "", + "12" : "01", + "13" : "111", + "14" : "DA", + "15" : "22", + "16" : "20100101", + name : "BPR", }, { - "1": "1", - "2": "10100000000", - "3": "1000000000", - name: "TRN", + "1" : "1", + "2" : "10100000000", + "3" : "1000000000", + name : "TRN", }, { - "1": "EV", - "2": "ETIN", - name: "REF", + "1" : "EV", + "2" : "ETIN", + name : "REF", }, { - "1": "405", - "2": "20100101", - name: "DTM", + "1" : "405", + "2" : "20100101", + name : "DTM", }, { - "1": "PR", - "2": "NYSDOH", - name: "N1", + "1" : "PR", + "2" : "NYSDOH", + name : "N1", }, { - "1": "OFFICE OF HEALTH INSURANCE PROGRAMS", - "2": "CORNING TOWER, EMPIRE STATE PLAZA", - name: "N3", + "1" : "OFFICE OF HEALTH INSURANCE PROGRAMS", + "2" : "CORNING TOWER, EMPIRE STATE PLAZA", + name : "N3", }, { - "1": "ALBANY", - "2": "NY", - "3": "122370080", - name: "N4", + "1" : "ALBANY", + "2" : "NY", + "3" : "122370080", + name : "N4", }, { - "1": "BL", - "2": "PROVIDER SERVICES", - "3": "TE", - "4": "8003439000", - "5": "UR", - "6": "www.emedny.org", - name: "PER", + "1" : "BL", + "2" : "PROVIDER SERVICES", + "3" : "TE", + "4" : "8003439000", + "5" : "UR", + "6" : "www.emedny.org", + name : "PER", }, { - "1": "PE", - "2": "MAJOR MEDICAL PROVIDER", - "3": "XX", - "4": "9999999995", - name: "N1", + "1" : "PE", + "2" : "MAJOR MEDICAL PROVIDER", + "3" : "XX", + "4" : "9999999995", + name : "N1", }, { - "1": "TJ", - "2": "000000000", - name: "REF", + "1" : "TJ", + "2" : "000000000", + name : "REF", }, { - "1": "1", - name: "LX", + "1" : "1", + name : "LX", }, { - "1": "PATIENT ACCOUNT NUMBER", - "2": "1", - "3": "34.25", - "4": "34.25", - "5": "", - "6": "MC", - "7": "1000210000000030", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "1", + "3" : "34.25", + "4" : "34.25", + "5" : "", + "6" : "MC", + "7" : "1000210000000030", + "8" : "11", + name : "CLP", }, { - "1": "QC", - "2": "1", - "3": "SUBMITTED LAST", - "4": "SUBMITTED FIRST", - "5": "", - "6": "", - "7": "", - "8": "MI", - "9": "LL99999L", - name: "NM1", + "1" : "QC", + "2" : "1", + "3" : "SUBMITTED LAST", + "4" : "SUBMITTED FIRST", + "5" : "", + "6" : "", + "7" : "", + "8" : "MI", + "9" : "LL99999L", + name : "NM1", }, { - "1": "74", - "2": "1", - "3": "CORRECTED LAST", - "4": "CORRECTED FIRST", - name: "NM1", + "1" : "74", + "2" : "1", + "3" : "CORRECTED LAST", + "4" : "CORRECTED FIRST", + name : "NM1", }, { - "1": "EA", - "2": "PATIENT ACCOUNT NUMBER", - name: "REF", + "1" : "EA", + "2" : "PATIENT ACCOUNT NUMBER", + name : "REF", }, { - "1": "232", - "2": "20100101", - name: "DTM", + "1" : "232", + "2" : "20100101", + name : "DTM", }, { - "1": "233", - "2": "20100101", - name: "DTM", + "1" : "233", + "2" : "20100101", + name : "DTM", }, { - "1": "AU", - "2": "34.25", - name: "AMT", + "1" : "AU", + "2" : "34.25", + name : "AMT", }, { - "1": "HC", - "2": "6", - "3": "6", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2020", - "1-2": "RB", + "1" : "HC", + "2" : "6", + "3" : "6", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2020", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "6", - name: "AMT", + "1" : "B6", + "2" : "6", + name : "AMT", }, { - "1": "HC", - "2": "2.75", - "3": "2.75", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2700", - "1-2": "RB", + "1" : "HC", + "2" : "2.75", + "3" : "2.75", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2700", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "2.75", - name: "AMT", + "1" : "B6", + "2" : "2.75", + name : "AMT", }, { - "1": "HC", - "2": "5.5", - "3": "5.5", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2103", - "1-2": "RB", + "1" : "HC", + "2" : "5.5", + "3" : "5.5", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2103", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "5.5", - name: "AMT", + "1" : "B6", + "2" : "5.5", + name : "AMT", }, { - "1": "HC", - "2": "20", - "3": "20", - "4": "", - "5": "2", - name: "SVC", - "1-1": "S0580", + "1" : "HC", + "2" : "20", + "3" : "20", + "4" : "", + "5" : "2", + name : "SVC", + "1-1" : "S0580", }, - { "1": "472", "2": "20100101", name: "DTM" }, + {"1" : "472", "2" : "20100101", name : "DTM"}, { - "1": "B6", - "2": "20", - name: "AMT", + "1" : "B6", + "2" : "20", + name : "AMT", }, { - "1": "PATIENT ACCOUNT NUMBER", - "2": "2", - "3": "34", - "4": "0", - "5": "", - "6": "MC", - "7": "1000220000000020", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "2", + "3" : "34", + "4" : "0", + "5" : "", + "6" : "MC", + "7" : "1000220000000020", + "8" : "11", + name : "CLP", }, { - "1": "QC", - "2": "1", - "3": "SUBMITTED LAST", - "4": "SUBMITTED FIRST", - "5": "", - "6": "", - "7": "", - "8": "MI", - "9": "LL88888L", - name: "NM1", + "1" : "QC", + "2" : "1", + "3" : "SUBMITTED LAST", + "4" : "SUBMITTED FIRST", + "5" : "", + "6" : "", + "7" : "", + "8" : "MI", + "9" : "LL88888L", + name : "NM1", }, { - "1": "74", - "2": "1", - "3": "CORRECTED LAST", - "4": "CORRECTED FIRST", - name: "NM1", + "1" : "74", + "2" : "1", + "3" : "CORRECTED LAST", + "4" : "CORRECTED FIRST", + name : "NM1", }, { - "1": "EA", - "2": "PATIENT ACCOUNT NUMBER", - name: "REF", + "1" : "EA", + "2" : "PATIENT ACCOUNT NUMBER", + name : "REF", }, { - "1": "232", - "2": "20100101", - name: "DTM", + "1" : "232", + "2" : "20100101", + name : "DTM", }, { - "1": "233", - "2": "20100101", - name: "DTM", + "1" : "233", + "2" : "20100101", + name : "DTM", }, { - "1": "HC", - "2": "12", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "V2020", + "1" : "HC", + "2" : "12", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "V2020", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "29", - "3": "12", - name: "CAS", + "1" : "CO", + "2" : "29", + "3" : "12", + name : "CAS", }, { - "1": "HC", - "2": "22", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "V2103", + "1" : "HC", + "2" : "22", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "V2103", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "29", - "3": "22", - name: "CAS", + "1" : "CO", + "2" : "29", + "3" : "22", + name : "CAS", }, { - "1": "PATIENT ACCOUNT NUMBER", - "2": "2", - "3": "34.25", - "4": "11.5", - "5": "", - "6": "MC", - "7": "1000230000000020", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "2", + "3" : "34.25", + "4" : "11.5", + "5" : "", + "6" : "MC", + "7" : "1000230000000020", + "8" : "11", + name : "CLP", }, { - "1": "QC", - "2": "1", - "3": "SUBMITTED LAST", - "4": "SUBMITTED FIRST", - "5": "", - "6": "", - "7": "", - "8": "MI", - "9": "LL77777L", - name: "NM1", + "1" : "QC", + "2" : "1", + "3" : "SUBMITTED LAST", + "4" : "SUBMITTED FIRST", + "5" : "", + "6" : "", + "7" : "", + "8" : "MI", + "9" : "LL77777L", + name : "NM1", }, { - "1": "74", - "2": "1", - "3": "CORRECTED LAST", - "4": "CORRECTED FIRST", - name: "NM1", + "1" : "74", + "2" : "1", + "3" : "CORRECTED LAST", + "4" : "CORRECTED FIRST", + name : "NM1", }, { - "1": "EA", - "2": "PATIENT ACCOUNT NUMBER", - name: "REF", + "1" : "EA", + "2" : "PATIENT ACCOUNT NUMBER", + name : "REF", }, { - "1": "232", - "2": "20100101", - name: "DTM", + "1" : "232", + "2" : "20100101", + name : "DTM", }, { - "1": "233", - "2": "20100101", - name: "DTM", + "1" : "233", + "2" : "20100101", + name : "DTM", }, { - "1": "AU", - "2": "11.5", - name: "AMT", + "1" : "AU", + "2" : "11.5", + name : "AMT", }, { - "1": "HC", - "2": "6", - "3": "6", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2020", - "1-2": "RB", + "1" : "HC", + "2" : "6", + "3" : "6", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2020", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "6", - name: "AMT", + "1" : "B6", + "2" : "6", + name : "AMT", }, { - "1": "HC", - "2": "5.5", - "3": "5.5", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2103", - "1-2": "RB", + "1" : "HC", + "2" : "5.5", + "3" : "5.5", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2103", + "1-2" : "RB", }, { - "1": "472", - "2": "20130917", - name: "DTM", + "1" : "472", + "2" : "20130917", + name : "DTM", }, { - "1": "B6", - "2": "5.5", - name: "AMT", + "1" : "B6", + "2" : "5.5", + name : "AMT", }, { - "1": "HC", - "2": "2.75", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "V2700", - "1-2": "RB", + "1" : "HC", + "2" : "2.75", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "V2700", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "251", - "3": "2.75", - name: "CAS", + "1" : "CO", + "2" : "251", + "3" : "2.75", + name : "CAS", }, { - "1": "HE", - "2": "N206", - name: "LQ", + "1" : "HE", + "2" : "N206", + name : "LQ", }, { - "1": "HC", - "2": "20", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "S0580", + "1" : "HC", + "2" : "20", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "S0580", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "251", - "3": "20", - name: "CAS", + "1" : "CO", + "2" : "251", + "3" : "20", + name : "CAS", }, { - "1": "HE", - "2": "N206", - name: "LQ", + "1" : "HE", + "2" : "N206", + name : "LQ", }, { - "1": "65", - "2": "1740", - name: "SE", + "1" : "65", + "2" : "1740", + name : "SE", }, { - "1": "1", - "2": "6000600", - name: "GE", + "1" : "1", + "2" : "6000600", + name : "GE", }, { - "1": "1", - "2": "006000600", - name: "IEA", + "1" : "1", + "2" : "006000600", + name : "IEA", }, ]; exports.groupedByISA = { - name: "Envelope", - data: [ + name : "Envelope", + data : [ { - "1": "00", - "2": "", - "3": "00", - "4": "", - "5": "ZZ", - "6": "EMEDNYBAT", - "7": "ZZ", - "8": "ETIN", - "9": "100101", - "10": "1000", - "11": "^", - "12": "00501", - "13": "006000600", - "14": "0", - "15": "T", - "16": ":", - name: "ISA", + "1" : "00", + "2" : "", + "3" : "00", + "4" : "", + "5" : "ZZ", + "6" : "EMEDNYBAT", + "7" : "ZZ", + "8" : "ETIN", + "9" : "100101", + "10" : "1000", + "11" : "^", + "12" : "00501", + "13" : "006000600", + "14" : "0", + "15" : "T", + "16" : ":", + name : "ISA", }, { - "1": "HP", - "2": "EMEDNYBAT", - "3": "ETIN", - "4": "20100101", - "5": "1050", - "6": "6000600", - "7": "X", - "8": "005010X221A1", - name: "GS", + "1" : "HP", + "2" : "EMEDNYBAT", + "3" : "ETIN", + "4" : "20100101", + "5" : "1050", + "6" : "6000600", + "7" : "X", + "8" : "005010X221A1", + name : "GS", }, { - "1": "835", - "2": "1740", - name: "ST", + "1" : "835", + "2" : "1740", + name : "ST", }, { - name: "headers", - data: [ + name : "headers", + data : [ { - "1": "I", - "2": "45.75", - "3": "C", - "4": "ACH", - "5": "CCP", - "6": "01", - "7": "111", - "8": "DA", - "9": "33", - "10": "1234567890", - "11": "", - "12": "01", - "13": "111", - "14": "DA", - "15": "22", - "16": "20100101", - name: "BPR", + "1" : "I", + "2" : "45.75", + "3" : "C", + "4" : "ACH", + "5" : "CCP", + "6" : "01", + "7" : "111", + "8" : "DA", + "9" : "33", + "10" : "1234567890", + "11" : "", + "12" : "01", + "13" : "111", + "14" : "DA", + "15" : "22", + "16" : "20100101", + name : "BPR", }, { - "1": "1", - "2": "10100000000", - "3": "1000000000", - name: "TRN", + "1" : "1", + "2" : "10100000000", + "3" : "1000000000", + name : "TRN", }, { - "1": "EV", - "2": "ETIN", - name: "REF", + "1" : "EV", + "2" : "ETIN", + name : "REF", }, { - "1": "405", - "2": "20100101", - name: "DTM", + "1" : "405", + "2" : "20100101", + name : "DTM", }, ], }, { - name: "1000", - data: [ + name : "1000", + data : [ { - "1": "PR", - "2": "NYSDOH", - name: "N1", + "1" : "PR", + "2" : "NYSDOH", + name : "N1", }, { - "1": "OFFICE OF HEALTH INSURANCE PROGRAMS", - "2": "CORNING TOWER, EMPIRE STATE PLAZA", - name: "N3", + "1" : "OFFICE OF HEALTH INSURANCE PROGRAMS", + "2" : "CORNING TOWER, EMPIRE STATE PLAZA", + name : "N3", }, { - "1": "ALBANY", - "2": "NY", - "3": "122370080", - name: "N4", + "1" : "ALBANY", + "2" : "NY", + "3" : "122370080", + name : "N4", }, { - "1": "BL", - "2": "PROVIDER SERVICES", - "3": "TE", - "4": "8003439000", - "5": "UR", - "6": "www.emedny.org", - name: "PER", + "1" : "BL", + "2" : "PROVIDER SERVICES", + "3" : "TE", + "4" : "8003439000", + "5" : "UR", + "6" : "www.emedny.org", + name : "PER", }, ], }, { - name: "1000", - data: [ + name : "1000", + data : [ { - "1": "PE", - "2": "MAJOR MEDICAL PROVIDER", - "3": "XX", - "4": "9999999995", - name: "N1", + "1" : "PE", + "2" : "MAJOR MEDICAL PROVIDER", + "3" : "XX", + "4" : "9999999995", + name : "N1", }, { - "1": "TJ", - "2": "000000000", - name: "REF", + "1" : "TJ", + "2" : "000000000", + name : "REF", }, ], }, { - name: "2000", - data: [ + name : "2000", + data : [ { - "1": "1", - name: "LX", + "1" : "1", + name : "LX", }, { - name: "2100", - data: [ + name : "2100", + data : [ { - "1": "PATIENT ACCOUNT NUMBER", - "2": "1", - "3": "34.25", - "4": "34.25", - "5": "", - "6": "MC", - "7": "1000210000000030", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "1", + "3" : "34.25", + "4" : "34.25", + "5" : "", + "6" : "MC", + "7" : "1000210000000030", + "8" : "11", + name : "CLP", }, { - "1": "QC", - "2": "1", - "3": "SUBMITTED LAST", - "4": "SUBMITTED FIRST", - "5": "", - "6": "", - "7": "", - "8": "MI", - "9": "LL99999L", - name: "NM1", + "1" : "QC", + "2" : "1", + "3" : "SUBMITTED LAST", + "4" : "SUBMITTED FIRST", + "5" : "", + "6" : "", + "7" : "", + "8" : "MI", + "9" : "LL99999L", + name : "NM1", }, { - "1": "74", - "2": "1", - "3": "CORRECTED LAST", - "4": "CORRECTED FIRST", - name: "NM1", + "1" : "74", + "2" : "1", + "3" : "CORRECTED LAST", + "4" : "CORRECTED FIRST", + name : "NM1", }, { - "1": "EA", - "2": "PATIENT ACCOUNT NUMBER", - name: "REF", + "1" : "EA", + "2" : "PATIENT ACCOUNT NUMBER", + name : "REF", }, { - "1": "232", - "2": "20100101", - name: "DTM", + "1" : "232", + "2" : "20100101", + name : "DTM", }, { - "1": "233", - "2": "20100101", - name: "DTM", + "1" : "233", + "2" : "20100101", + name : "DTM", }, { - "1": "AU", - "2": "34.25", - name: "AMT", + "1" : "AU", + "2" : "34.25", + name : "AMT", }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "6", - "3": "6", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2020", - "1-2": "RB", + "1" : "HC", + "2" : "6", + "3" : "6", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2020", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "6", - name: "AMT", + "1" : "B6", + "2" : "6", + name : "AMT", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "2.75", - "3": "2.75", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2700", - "1-2": "RB", + "1" : "HC", + "2" : "2.75", + "3" : "2.75", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2700", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "2.75", - name: "AMT", + "1" : "B6", + "2" : "2.75", + name : "AMT", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "5.5", - "3": "5.5", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2103", - "1-2": "RB", + "1" : "HC", + "2" : "5.5", + "3" : "5.5", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2103", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "5.5", - name: "AMT", + "1" : "B6", + "2" : "5.5", + name : "AMT", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "20", - "3": "20", - "4": "", - "5": "2", - name: "SVC", - "1-1": "S0580", + "1" : "HC", + "2" : "20", + "3" : "20", + "4" : "", + "5" : "2", + name : "SVC", + "1-1" : "S0580", }, - { "1": "472", "2": "20100101", name: "DTM" }, + {"1" : "472", "2" : "20100101", name : "DTM"}, { - "1": "B6", - "2": "20", - name: "AMT", + "1" : "B6", + "2" : "20", + name : "AMT", }, ], }, ], }, { - name: "2100", - data: [ + name : "2100", + data : [ { - "1": "PATIENT ACCOUNT NUMBER", - "2": "2", - "3": "34", - "4": "0", - "5": "", - "6": "MC", - "7": "1000220000000020", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "2", + "3" : "34", + "4" : "0", + "5" : "", + "6" : "MC", + "7" : "1000220000000020", + "8" : "11", + name : "CLP", }, { - "1": "QC", - "2": "1", - "3": "SUBMITTED LAST", - "4": "SUBMITTED FIRST", - "5": "", - "6": "", - "7": "", - "8": "MI", - "9": "LL88888L", - name: "NM1", + "1" : "QC", + "2" : "1", + "3" : "SUBMITTED LAST", + "4" : "SUBMITTED FIRST", + "5" : "", + "6" : "", + "7" : "", + "8" : "MI", + "9" : "LL88888L", + name : "NM1", }, { - "1": "74", - "2": "1", - "3": "CORRECTED LAST", - "4": "CORRECTED FIRST", - name: "NM1", + "1" : "74", + "2" : "1", + "3" : "CORRECTED LAST", + "4" : "CORRECTED FIRST", + name : "NM1", }, { - "1": "EA", - "2": "PATIENT ACCOUNT NUMBER", - name: "REF", + "1" : "EA", + "2" : "PATIENT ACCOUNT NUMBER", + name : "REF", }, { - "1": "232", - "2": "20100101", - name: "DTM", + "1" : "232", + "2" : "20100101", + name : "DTM", }, { - "1": "233", - "2": "20100101", - name: "DTM", + "1" : "233", + "2" : "20100101", + name : "DTM", }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "12", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "V2020", + "1" : "HC", + "2" : "12", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "V2020", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "29", - "3": "12", - name: "CAS", + "1" : "CO", + "2" : "29", + "3" : "12", + name : "CAS", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "22", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "V2103", + "1" : "HC", + "2" : "22", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "V2103", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "29", - "3": "22", - name: "CAS", + "1" : "CO", + "2" : "29", + "3" : "22", + name : "CAS", }, ], }, ], }, { - name: "2100", - data: [ + name : "2100", + data : [ { - "1": "PATIENT ACCOUNT NUMBER", - "2": "2", - "3": "34.25", - "4": "11.5", - "5": "", - "6": "MC", - "7": "1000230000000020", - "8": "11", - name: "CLP", + "1" : "PATIENT ACCOUNT NUMBER", + "2" : "2", + "3" : "34.25", + "4" : "11.5", + "5" : "", + "6" : "MC", + "7" : "1000230000000020", + "8" : "11", + name : "CLP", }, { - "1": "QC", - "2": "1", - "3": "SUBMITTED LAST", - "4": "SUBMITTED FIRST", - "5": "", - "6": "", - "7": "", - "8": "MI", - "9": "LL77777L", - name: "NM1", + "1" : "QC", + "2" : "1", + "3" : "SUBMITTED LAST", + "4" : "SUBMITTED FIRST", + "5" : "", + "6" : "", + "7" : "", + "8" : "MI", + "9" : "LL77777L", + name : "NM1", }, { - "1": "74", - "2": "1", - "3": "CORRECTED LAST", - "4": "CORRECTED FIRST", - name: "NM1", + "1" : "74", + "2" : "1", + "3" : "CORRECTED LAST", + "4" : "CORRECTED FIRST", + name : "NM1", }, { - "1": "EA", - "2": "PATIENT ACCOUNT NUMBER", - name: "REF", + "1" : "EA", + "2" : "PATIENT ACCOUNT NUMBER", + name : "REF", }, { - "1": "232", - "2": "20100101", - name: "DTM", + "1" : "232", + "2" : "20100101", + name : "DTM", }, { - "1": "233", - "2": "20100101", - name: "DTM", + "1" : "233", + "2" : "20100101", + name : "DTM", }, { - "1": "AU", - "2": "11.5", - name: "AMT", + "1" : "AU", + "2" : "11.5", + name : "AMT", }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "6", - "3": "6", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2020", - "1-2": "RB", + "1" : "HC", + "2" : "6", + "3" : "6", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2020", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "B6", - "2": "6", - name: "AMT", + "1" : "B6", + "2" : "6", + name : "AMT", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "5.5", - "3": "5.5", - "4": "", - "5": "1", - name: "SVC", - "1-1": "V2103", - "1-2": "RB", + "1" : "HC", + "2" : "5.5", + "3" : "5.5", + "4" : "", + "5" : "1", + name : "SVC", + "1-1" : "V2103", + "1-2" : "RB", }, { - "1": "472", - "2": "20130917", - name: "DTM", + "1" : "472", + "2" : "20130917", + name : "DTM", }, { - "1": "B6", - "2": "5.5", - name: "AMT", + "1" : "B6", + "2" : "5.5", + name : "AMT", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "2.75", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "V2700", - "1-2": "RB", + "1" : "HC", + "2" : "2.75", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "V2700", + "1-2" : "RB", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "251", - "3": "2.75", - name: "CAS", + "1" : "CO", + "2" : "251", + "3" : "2.75", + name : "CAS", }, { - "1": "HE", - "2": "N206", - name: "LQ", + "1" : "HE", + "2" : "N206", + name : "LQ", }, ], }, { - name: "2110", - data: [ + name : "2110", + data : [ { - "1": "HC", - "2": "20", - "3": "0", - "4": "", - "5": "0", - name: "SVC", - "1-1": "S0580", + "1" : "HC", + "2" : "20", + "3" : "0", + "4" : "", + "5" : "0", + name : "SVC", + "1-1" : "S0580", }, { - "1": "472", - "2": "20100101", - name: "DTM", + "1" : "472", + "2" : "20100101", + name : "DTM", }, { - "1": "CO", - "2": "251", - "3": "20", - name: "CAS", + "1" : "CO", + "2" : "251", + "3" : "20", + name : "CAS", }, { - "1": "HE", - "2": "N206", - name: "LQ", + "1" : "HE", + "2" : "N206", + name : "LQ", }, ], }, @@ -1029,51 +1029,51 @@ exports.groupedByISA = { ], }, { - "1": "65", - "2": "1740", - name: "SE", + "1" : "65", + "2" : "1740", + name : "SE", }, { - "1": "1", - "2": "6000600", - name: "GE", + "1" : "1", + "2" : "6000600", + name : "GE", }, { - "1": "1", - "2": "006000600", - name: "IEA", + "1" : "1", + "2" : "006000600", + name : "IEA", }, ], }; exports.groupedByISAschema = { - start: "ISA", // What segment starts the group - end: "IEA", // What segment ends the group - name: "Envelope", // What is the name of the group - groups: [ + start : "ISA", // What segment starts the group + end : "IEA", // What segment ends the group + name : "Envelope", // What is the name of the group + groups : [ // Nested groups { - start: "BPR", - terminators: ["N1"], - name: "headers", + start : "BPR", + terminators : [ "N1" ], + name : "headers", }, { - start: "N1", - terminators: ["LX"], - name: "1000", + start : "N1", + terminators : [ "LX" ], + name : "1000", }, { - start: "LX", - name: "2000", - terminators: ["SE"], - groups: [ + start : "LX", + name : "2000", + terminators : [ "SE" ], + groups : [ { - start: "CLP", - name: "2100", - groups: [ + start : "CLP", + name : "2100", + groups : [ { - start: "SVC", - name: "2110", + start : "SVC", + name : "2110", }, ], }, diff --git a/test_harness/x12_test_harness/x12grouper.js b/test_harness/x12_test_harness/x12grouper.js index 724207a..24a838d 100644 --- a/test_harness/x12_test_harness/x12grouper.js +++ b/test_harness/x12_test_harness/x12grouper.js @@ -1,16 +1,16 @@ -const { X12grouper, Schema } = require("../index"); +const {X12grouper, Schema} = require("../index"); const assert = require("assert"); -const { finished } = require("./testFiles/835/profee-done"); +const {finished} = require("./testFiles/835/profee-done"); const schema = { - start: "CLP", // What segment starts the group - terminators: ["SE"], // What segment ends the group - name: "2100", // What is the name of the group - groups: [ + start : "CLP", // What segment starts the group + terminators : [ "SE" ], // What segment ends the group + name : "2100", // What is the name of the group + groups : [ // Nested groups { - start: "SVC", - name: "2110", + start : "SVC", + name : "2110", }, ], }; @@ -18,91 +18,97 @@ const schema = { const testSchema = new Schema("005010X221A1", schema, true); const testSchema2 = new Schema("005010X221", schema, false); -//TODO: Still need to add unit tests for some specific methods -describe("X12grouper", function () { - describe("#constructor()", function () { +// TODO: Still need to add unit tests for some specific methods +describe("X12grouper", function() { + describe("#constructor()", function() { const myGrouper = new X12grouper(testSchema); - it("Should return an X12grouper", function () { - assert(myGrouper instanceof X12grouper); - }); - it("Should have a pipe function", function () { - assert.strictEqual(typeof myGrouper.pipe, "function"); - }); - it("Should return an event emitter", function () { + it("Should return an X12grouper", + function() { assert(myGrouper instanceof X12grouper); }); + it("Should have a pipe function", + function() { assert.strictEqual(typeof myGrouper.pipe, "function"); }); + it("Should return an event emitter", function() { assert(myGrouper instanceof require("events").EventEmitter); }); - it("Should accept a single schema object", function () { + it("Should accept a single schema object", function() { const tmpGrouper = new X12grouper(testSchema); - assert.deepStrictEqual(tmpGrouper._schemas, [testSchema]); + assert.deepStrictEqual(tmpGrouper._schemas, [ testSchema ]); }); - it("Should accept an array of schemas", function () { - const tmpGrouper = new X12grouper([testSchema, testSchema2]); - assert.deepStrictEqual(tmpGrouper._schemas, [testSchema, testSchema2]); + it("Should accept an array of schemas", function() { + const tmpGrouper = new X12grouper([ testSchema, testSchema2 ]); + assert.deepStrictEqual(tmpGrouper._schemas, [ testSchema, testSchema2 ]); }); }); - describe("#processSegment()", function () { - it("ISA should go into an intial hold", function () { + describe("#processSegment()", function() { + it("ISA should go into an intial hold", function() { const tmpGrouper = new X12grouper(testSchema); tmpGrouper.write(finished[0]); // ISA assert.deepStrictEqual(tmpGrouper._initialHold[0], finished[0]); }); - it("Items in initial hold should come down pipe before new segment", function () { - // ISA -> Hold - // GS -> Process Hold (ISA) -> Process GS - const tmpGrouper = new X12grouper(testSchema); - let counter = 0; - tmpGrouper.on("data", (data) => { - assert.deepStrictEqual(finished[counter], data); - counter++; - }); - tmpGrouper.write(finished[0]); // ISA - tmpGrouper.write(finished[1]); // GS - }); + it("Items in initial hold should come down pipe before new segment", + function() { + // ISA -> Hold + // GS -> Process Hold (ISA) -> Process GS + const tmpGrouper = new X12grouper(testSchema); + let counter = 0; + tmpGrouper.on("data", (data) => { + assert.deepStrictEqual(finished[counter], data); + counter++; + }); + tmpGrouper.write(finished[0]); // ISA + tmpGrouper.write(finished[1]); // GS + }); }); - describe("Schema detection", function () { - it("Should set the version to GS08", function () { - const tmpGrouper = new X12grouper([testSchema, testSchema2]); + describe("Schema detection", function() { + it("Should set the version to GS08", function() { + const tmpGrouper = new X12grouper([ testSchema, testSchema2 ]); tmpGrouper.write(finished[1]); assert.strictEqual(tmpGrouper._version, "005010X221A1"); - tmpGrouper.write({ ...finished[1], "8": "005010X221" }); - assert.strictEqual(tmpGrouper._version, "005010X221"); - }); - it("The first schema marked as default will be the default schema", function () { - const tmpGrouper = new X12grouper([testSchema2, testSchema]); - assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema); - }); - it("If no schemas are marked as the default the first schema will be used as default", function () { - const tmpGrouper = new X12grouper([ - testSchema2, - new Schema("005010X221A1", schema), - ]); - assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema2); - }); - it("If there is a schema version that matches GS08 it will be used", function () { - const tmpSchema = new Schema("005010X221A1", { ...schema, name: "test" }); - const tmpGrouper = new X12grouper([testSchema2, tmpSchema]); - tmpGrouper.write(finished[1]); // GS - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); - }); - it("If there is no schema version that matches GS08 the default will be used", function () { - const tmpSchema = new Schema("random", { ...schema, name: "test" }); - const tmpGrouper = new X12grouper([testSchema2, tmpSchema]); - tmpGrouper.write(finished[1]); // GS - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); - }); - it("If segment is GS it will update the version and use new schema", function () { - const tmpSchema = new Schema("005010X221A1", { ...schema, name: "test" }); - const tmpGrouper = new X12grouper([testSchema2, tmpSchema]); - tmpGrouper.write(finished[1]); // GS - 005010X221A1 - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._version, "005010X221A1"); - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); - tmpGrouper.write({ ...finished[1], "8": "005010X221" }); // GS - tmpGrouper.write(finished[14]); // CLP + tmpGrouper.write({...finished[1], "8" : "005010X221"}); assert.strictEqual(tmpGrouper._version, "005010X221"); - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); }); + it("The first schema marked as default will be the default schema", + function() { + const tmpGrouper = new X12grouper([ testSchema2, testSchema ]); + assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema); + }); + it("If no schemas are marked as the default the first schema will be used as default", + function() { + const tmpGrouper = new X12grouper([ + testSchema2, + new Schema("005010X221A1", schema), + ]); + assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema2); + }); + it("If there is a schema version that matches GS08 it will be used", + function() { + const tmpSchema = + new Schema("005010X221A1", {...schema, name : "test"}); + const tmpGrouper = new X12grouper([ testSchema2, tmpSchema ]); + tmpGrouper.write(finished[1]); // GS + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); + }); + it("If there is no schema version that matches GS08 the default will be used", + function() { + const tmpSchema = new Schema("random", {...schema, name : "test"}); + const tmpGrouper = new X12grouper([ testSchema2, tmpSchema ]); + tmpGrouper.write(finished[1]); // GS + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); + }); + it("If segment is GS it will update the version and use new schema", + function() { + const tmpSchema = + new Schema("005010X221A1", {...schema, name : "test"}); + const tmpGrouper = new X12grouper([ testSchema2, tmpSchema ]); + tmpGrouper.write(finished[1]); // GS - 005010X221A1 + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._version, "005010X221A1"); + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); + tmpGrouper.write({...finished[1], "8" : "005010X221"}); // GS + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._version, "005010X221"); + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); + }); }); }); diff --git a/test_harness/x12_test_harness/x12parser.js b/test_harness/x12_test_harness/x12parser.js index ffe8c2f..c0b5f2a 100644 --- a/test_harness/x12_test_harness/x12parser.js +++ b/test_harness/x12_test_harness/x12parser.js @@ -1,117 +1,114 @@ -const { X12parser } = require("../index"); +const {X12parser} = require("../index"); const assert = require("assert"); -const { createReadStream } = require("fs"); +const {createReadStream} = require("fs"); -describe("X12parser", function () { - describe("#constructor()", function () { +describe("X12parser", function() { + describe("#constructor()", function() { const myParser = new X12parser(); - it("Should return an X12parser", function () { - assert(myParser instanceof X12parser); - }); - it("Should have a pipe function", function () { - assert.strictEqual(typeof myParser.pipe, "function"); - }); - it("Should return an event emitter", function () { + it("Should return an X12parser", + function() { assert(myParser instanceof X12parser); }); + it("Should have a pipe function", + function() { assert.strictEqual(typeof myParser.pipe, "function"); }); + it("Should return an event emitter", function() { assert(myParser instanceof require("events").EventEmitter); }); }); - describe("#detectDelimiters()", function () { + describe("#detectDelimiters()", function() { const isa1 = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; const isa2 = - "ISA&00& &00& &ZZ&EMEDNYBAT &ZZ&ETIN &100101&1000&#&00501&006000600&0&T&@$"; - it("Should be abl to auto detect delimiters from ISA", function () { + "ISA&00& &00& &ZZ&EMEDNYBAT &ZZ&ETIN &100101&1000&#&00501&006000600&0&T&@$"; + it("Should be abl to auto detect delimiters from ISA", function() { assert.deepEqual(X12parser.detectDelimiters(isa1), { - segment: "~", - component: ":", - element: "*", - repetition: "^", + segment : "~", + component : ":", + element : "*", + repetition : "^", }); assert.deepEqual(X12parser.detectDelimiters(isa2), { - segment: "$", - component: "@", - element: "&", - repetition: "#", + segment : "$", + component : "@", + element : "&", + repetition : "#", }); }); }); - describe("#removeDelimiters()", function () { + describe("#removeDelimiters()", function() { const myParser = new X12parser(); myParser._delimiters = { - segment: "~", - component: ":", - element: "*", - repetition: "^", + segment : "~", + component : ":", + element : "*", + repetition : "^", }; const isa1 = - "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; + "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; const isa2 = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; const isa3 = - "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; + "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; const delimitersRemoved = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; - it("Should remove delimiter from start of string", function () { + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; + it("Should remove delimiter from start of string", function() { assert.deepEqual(myParser.removeDelimiters(isa1), delimitersRemoved); }); - it("Should remove delimiter from end of string", function () { + it("Should remove delimiter from end of string", function() { assert.deepEqual(myParser.removeDelimiters(isa2), delimitersRemoved); }); - it("Should remove delimiter from start and end of string", function () { + it("Should remove delimiter from start and end of string", function() { assert.deepEqual(myParser.removeDelimiters(isa3), delimitersRemoved); }); }); - describe("835 File Tests", function () { - it("Should parse files with CRLF", function () { + describe("835 File Tests", function() { + it("Should parse files with CRLF", function() { const myParser = new X12parser(); const testFile = createReadStream("./test/testFiles/835/profee.edi"); let counter = 0; // So ugly... This should be done nicer - const { finished } = require("./testFiles/835/profee-done"); + const {finished} = require("./testFiles/835/profee-done"); testFile.pipe(myParser).on("data", (data) => { assert.deepStrictEqual(data, finished[counter]); counter++; }); }); - it("Should parse single line files", function () { + it("Should parse single line files", function() { const myParser = new X12parser(); - const testFile = createReadStream( - "./test/testFiles/835/profeeOneLine.edi" - ); + const testFile = + createReadStream("./test/testFiles/835/profeeOneLine.edi"); let counter = 0; // So ugly... This should be done nicer - const { finished } = require("./testFiles/835/profee-done"); + const {finished} = require("./testFiles/835/profee-done"); testFile.pipe(myParser).on("data", (data) => { assert.deepStrictEqual(data, finished[counter]); counter++; }); }); - it("Should parse multiple transactions (ISA) in a single file", function () { + it("Should parse multiple transactions (ISA) in a single file", function() { const myParser = new X12parser(); - const testFile = createReadStream( - "./test/testFiles/835/profeeMultiple.edi" - ); + const testFile = + createReadStream("./test/testFiles/835/profeeMultiple.edi"); let counter = 0; // So ugly... This should be done nicer - const { finished } = require("./testFiles/835/profee-done"); + const {finished} = require("./testFiles/835/profee-done"); testFile.pipe(myParser).on("data", (data) => { if (!finished[counter]) - // Super ugly, but resets counter if undefined since it's same ISA just duplicated in file + // Super ugly, but resets counter if undefined since it's same ISA + // just duplicated in file counter = 0; assert.deepStrictEqual(data, finished[counter]); counter++; }); }); - it("Should parse multiline files without delimiter (LF/CRLF is delimiter)", function () { - const myParser = new X12parser(); - const testFile = createReadStream( - "./test/testFiles/835/multiLineNotDelimited.edi" - ); - let counter = 0; // So ugly... This should be done nicer - const { finished } = require("./testFiles/835/profee-done"); - testFile.pipe(myParser).on("data", (data) => { - assert.deepStrictEqual(data, finished[counter]); - counter++; - }); - }); + it("Should parse multiline files without delimiter (LF/CRLF is delimiter)", + function() { + const myParser = new X12parser(); + const testFile = + createReadStream("./test/testFiles/835/multiLineNotDelimited.edi"); + let counter = 0; // So ugly... This should be done nicer + const {finished} = require("./testFiles/835/profee-done"); + testFile.pipe(myParser).on("data", (data) => { + assert.deepStrictEqual(data, finished[counter]); + counter++; + }); + }); }); }); From 2de83fa6aaa790c83eb3e79d4adad4c224d75426 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 Jul 2020 18:34:22 +0000 Subject: [PATCH 2/6] Restyled by jq --- ROOT/BOLWorkflow.json | 25 +- ROOT/BillOfLadingModel.json | 20 +- ROOT/LoadContactInfo.json | 2 - ROOT/SpecialServicesCode.json | 10 +- napp.json | 190 ++++++++++--- spec_configs/lei-jsonld.json | 384 ++++++++++++++++++++------- spec_configs/lei.json | 116 ++++++-- spec_trade/event_orderProcessed.json | 4 +- spec_user_entity/entityType.json | 8 +- 9 files changed, 583 insertions(+), 176 deletions(-) diff --git a/ROOT/BOLWorkflow.json b/ROOT/BOLWorkflow.json index 7cc229b..7f56876 100644 --- a/ROOT/BOLWorkflow.json +++ b/ROOT/BOLWorkflow.json @@ -16,10 +16,22 @@ "format": "uri", "type": "string", "description": "pki", - "enum": ["notify", "notifyAll", "getClass", "finalize"] + "enum": [ + "notify", + "notifyAll", + "getClass", + "finalize" + ] }, "GoverningLaw": { - "enum": ["MASTER_AGREEMENT", "USCA", "USDE", "USIL", "USNY", "OTHER"], + "enum": [ + "MASTER_AGREEMENT", + "USCA", + "USDE", + "USIL", + "USNY", + "OTHER" + ], "type": "string" }, "Cosignee": { @@ -47,11 +59,16 @@ "additionalProperties": { "format": null, "type": "object", - "required": ["checksum_digit"] + "required": [ + "checksum_digit" + ] } }, "AssetClass": { - "enum": [null, null], + "enum": [ + null, + null + ], "type": "string", "items": { "enum": null, diff --git a/ROOT/BillOfLadingModel.json b/ROOT/BillOfLadingModel.json index 8ccdcaf..4b549f0 100644 --- a/ROOT/BillOfLadingModel.json +++ b/ROOT/BillOfLadingModel.json @@ -16,10 +16,22 @@ "format": "uri", "type": "string", "description": "pki", - "enum": ["notify", "notifyAll", "getClass", "finalize"] + "enum": [ + "notify", + "notifyAll", + "getClass", + "finalize" + ] }, "GoverningLaw": { - "enum": ["MASTER_AGREEMENT", "USCA", "USDE", "USIL", "USNY", "OTHER"], + "enum": [ + "MASTER_AGREEMENT", + "USCA", + "USDE", + "USIL", + "USNY", + "OTHER" + ], "type": "string" }, "Cosignee": { @@ -47,7 +59,9 @@ "additionalProperties": { "format": null, "type": "object", - "required": ["checksum_digit"] + "required": [ + "checksum_digit" + ] } } } diff --git a/ROOT/LoadContactInfo.json b/ROOT/LoadContactInfo.json index eb088c1..121c935 100644 --- a/ROOT/LoadContactInfo.json +++ b/ROOT/LoadContactInfo.json @@ -1,10 +1,8 @@ { "Loop_G61_204": "LoadContactInfo", - "class": { "L11": "List", "Item": "G61", - "G61": { "Name": "G61.Name_02", "CommunicationNumberQualifier": "G61.CommunicationNumberQualifier_03", diff --git a/ROOT/SpecialServicesCode.json b/ROOT/SpecialServicesCode.json index 5940779..59f996c 100644 --- a/ROOT/SpecialServicesCode.json +++ b/ROOT/SpecialServicesCode.json @@ -1,6 +1,5 @@ { "type": "object", - "properties": { "SpecialServicesCode": { "D1": "One - Day Service", @@ -14,10 +13,13 @@ "ID": "Inside Delivery", "ZZ": "Mutually Defined" }, - "required": ["SpecialServicesCode"], - + "required": [ + "SpecialServicesCode" + ], "dependencies": { - "": [""] + "": [ + "" + ] } } } diff --git a/napp.json b/napp.json index f24d3d8..f567163 100644 --- a/napp.json +++ b/napp.json @@ -26,7 +26,9 @@ "operationId": "submitPayment", "description": "Payment initiation request related to a single credit transfer between a debtor and creditor.", "summary": "Submit Payment.", - "tags": ["REST API"], + "tags": [ + "REST API" + ], "parameters": [ { "name": "x-Correlation-Id", @@ -200,7 +202,9 @@ "operationId": "getPaymentStatus", "description": "Request sent by a OSP (Overlay Service Provider) in order to get the status of a given transaction.", "summary": "Get Payment Status.", - "tags": ["REST API"], + "tags": [ + "REST API" + ], "parameters": [ { "in": "path", @@ -362,7 +366,9 @@ "operationId": "getAccountServicerByAlias", "description": "Request to get the account servicer details for a given alias.", "summary": "Get Account Servicer By Alias.", - "tags": ["REST API"], + "tags": [ + "REST API" + ], "parameters": [ { "in": "query", @@ -371,7 +377,12 @@ "required": true, "schema": { "type": "string", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"] + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ] } }, { @@ -534,7 +545,9 @@ "operationId": "submitCancelPayment", "description": "This API allows a NPP Participant client (customer or Overlay Service Provider) to request the NPP Participant to return a previously submitted payment.", "summary": "Submit Cancel Payment.", - "tags": ["REST API"], + "tags": [ + "REST API" + ], "parameters": [ { "name": "x-Correlation-Id", @@ -708,7 +721,9 @@ "operationId": "submitReturnPayment", "description": "This API allows a NPP Participant client (customer or Overlay Service Provider) to request the NPP Participant to return a previously received payment.", "summary": "Submit Return Payment.", - "tags": ["REST API"], + "tags": [ + "REST API" + ], "parameters": [ { "name": "x-Correlation-Id", @@ -882,7 +897,9 @@ "operationId": "getPaymentEventDetails", "description": "Allows a NPP client (customer or Overlay Service Provider) to fetch from the NPP Participant details of a debit or credit to their account (e.g. under a API call-back arrangement).", "summary": "Get Payment Event Details.", - "tags": ["REST API"], + "tags": [ + "REST API" + ], "parameters": [ { "in": "path", @@ -1068,7 +1085,10 @@ "properties": { "severity": { "type": "string", - "enum": ["Fatal", "Transient"] + "enum": [ + "Fatal", + "Transient" + ] }, "code": { "type": "string", @@ -1103,10 +1123,16 @@ "type": "string" } }, - "required": ["severity", "code", "text"] + "required": [ + "severity", + "code", + "text" + ] } }, - "required": ["status"] + "required": [ + "status" + ] }, "AccountAliasResource": { "type": "object", @@ -1115,7 +1141,12 @@ "alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian\r\nBusiness Number.", "type": "string", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "TELI" }, "alias_value": { @@ -1149,7 +1180,10 @@ "example": "ADDR.API.0405 Alias Identifier in use" } }, - "required": ["alias_type", "alias_value"], + "required": [ + "alias_type", + "alias_value" + ], "example": { "alias_type": "TELI", "alias_value": "+61-4123456789", @@ -1198,7 +1232,10 @@ "instruction_priority": { "description": "Indicator of the urgency or order of importance that the instructing party would like the instructed party to apply to the processing of the instruction.", "type": "string", - "enum": ["HIGH", "NORM"], + "enum": [ + "HIGH", + "NORM" + ], "example": "NORM" }, "service_level": { @@ -1234,7 +1271,12 @@ "debtor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business\r\nNumber.", "type": "string", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "TELI" }, "debtor_alias_value": { @@ -1254,7 +1296,10 @@ "debtor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", "type": "string", - "enum": ["BBAN", "AIIN"], + "enum": [ + "BBAN", + "AIIN" + ], "example": "BBAN" }, "debtor_agent_bic": { @@ -1276,7 +1321,12 @@ "creditor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business\r\nNumber.", "type": "string", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "TELI" }, "creditor_alias_value": { @@ -1296,7 +1346,10 @@ "creditor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", "type": "string", - "enum": ["BBAN", "AIIN"], + "enum": [ + "BBAN", + "AIIN" + ], "example": "BBAN" }, "creditor_agent_bic": { @@ -1376,7 +1429,10 @@ "remiitance_referred_document_type": "CINV", "remittance_referred_document_number": "INV-12345678", "remittance_referred_related_date": "2018-08-23", - "remittance_information_unstructured": ["FIRST LINE", "SECOND LINE"] + "remittance_information_unstructured": [ + "FIRST LINE", + "SECOND LINE" + ] } }, "PaymentCancellationRequest": { @@ -1436,7 +1492,12 @@ "debtor_alias_type": { "type": "string", "description": "Specifies the type of alias identifier, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "TELI" }, "debtor_alias_value": { @@ -1456,7 +1517,10 @@ "debtor_account_type": { "type": "string", "description": "Name of the account identification identification scheme, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": ["BBAN", "AIIN"], + "enum": [ + "BBAN", + "AIIN" + ], "example": "BBAN" }, "original_creditor_name": { @@ -1469,7 +1533,12 @@ "creditor_alias_type": { "type": "string", "description": "Specifies the type of alias identifier, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "TELI" }, "creditor_alias_value": { @@ -1489,7 +1558,10 @@ "creditor_account_type": { "type": "string", "description": "Name of the account identification identification scheme, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": ["BBAN", "AIIN"], + "enum": [ + "BBAN", + "AIIN" + ], "example": "BBAN" } }, @@ -1519,7 +1591,9 @@ "example": "Case 12345678" } }, - "required": ["acceptance_date_time"] + "required": [ + "acceptance_date_time" + ] }, "PaymentReturnResource": { "type": "object", @@ -1633,7 +1707,9 @@ "example": "43ba8cc0-67ff-490f-abe5-5bb640bc3681" } }, - "required": ["notification_identification"] + "required": [ + "notification_identification" + ] }, "PaymentEventResponseResource": { "type": "object", @@ -1677,13 +1753,20 @@ "credit_debit_indicator": { "description": "Indicates whether the entry is a credit or a debit entry.", "type": "string", - "enum": ["CRDT", "DBIT"], + "enum": [ + "CRDT", + "DBIT" + ], "example": "CRDT" }, "status": { "description": "Status of an entry on the books of the account servicer.", "type": "string", - "enum": ["BOOK", "PDNG", "INFO"], + "enum": [ + "BOOK", + "PDNG", + "INFO" + ], "example": "CRDT" }, "booking_date_time": { @@ -1747,7 +1830,12 @@ "debtor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business\r\nNumber.", "type": "string", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "EMAL" }, "debtor_alias_value": { @@ -1767,7 +1855,10 @@ "debtor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", "type": "string", - "enum": ["BBAN", "AIIN"], + "enum": [ + "BBAN", + "AIIN" + ], "example": "BBAN" }, "debtor_agent_bic": { @@ -1790,7 +1881,12 @@ "creditor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business Number.", "type": "string", - "enum": ["TELI", "EMAL", "AUBN", "ORGN"], + "enum": [ + "TELI", + "EMAL", + "AUBN", + "ORGN" + ], "example": "EMAL" }, "creditor_alias_value": { @@ -1809,7 +1905,10 @@ }, "creditor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", - "enum": ["BBAN", "AIIN"], + "enum": [ + "BBAN", + "AIIN" + ], "example": "BBAN" }, "remittance_referred_document_type": { @@ -1864,7 +1963,10 @@ }, "credit_debit_indicator": { "type": "string", - "enum": ["CRDT", "DBIT"], + "enum": [ + "CRDT", + "DBIT" + ], "example": "CRDT" }, "charge_included_indicator": { @@ -1886,7 +1988,12 @@ "bearer": { "type": "string", "description": "Specifies which party(ies) will pay charges due for processing of the instruction.", - "enum": ["DEBT", "CRED", "SHAR", "SLEV"], + "enum": [ + "DEBT", + "CRED", + "SHAR", + "SLEV" + ], "example": "SLEV" }, "tax_identification": { @@ -1906,7 +2013,9 @@ "$ref": "#/components/schemas/ActiveOrHistoricCurrencyAndAmount" } }, - "required": ["amount"] + "required": [ + "amount" + ] }, "ActiveOrHistoricCurrencyAndAmount": { "type": "object", @@ -1921,7 +2030,10 @@ "example": 562.89 } }, - "required": ["currency", "amount"] + "required": [ + "currency", + "amount" + ] }, "ActiveOrHistoricCurrencyCode": { "type": "string", @@ -1936,7 +2048,11 @@ "transaction_status": { "description": "Specifies the status of a transaction, in a coded form.", "type": "string", - "enum": ["ACCP", "ACSC", "RJCT"], + "enum": [ + "ACCP", + "ACSC", + "RJCT" + ], "example": "ACCP" }, "transaction_status_reason_code": { @@ -1972,7 +2088,9 @@ "example": "3F2504E0-4F89-11D3-9A0C-0305E82C3301" } }, - "required": ["transaction_status"], + "required": [ + "transaction_status" + ], "example": { "transaction_status": "RJCT", "transaction_status_reason_code": "AC01", diff --git a/spec_configs/lei-jsonld.json b/spec_configs/lei-jsonld.json index 6fd01b2..c9cc1c0 100644 --- a/spec_configs/lei-jsonld.json +++ b/spec_configs/lei-jsonld.json @@ -1,7 +1,9 @@ [ { "@id": "_:genid1", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#minQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -21,7 +23,9 @@ }, { "@id": "_:genid11", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2002/07/owl#oneOf": [ { "@list": [ @@ -37,7 +41,9 @@ }, { "@id": "_:genid14", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -52,7 +58,9 @@ }, { "@id": "_:genid15", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onDataRange": [ { "@id": "http://www.w3.org/2001/XMLSchema#string" @@ -72,7 +80,9 @@ }, { "@id": "_:genid16", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -92,7 +102,9 @@ }, { "@id": "_:genid17", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -112,7 +124,9 @@ }, { "@id": "_:genid18", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onDataRange": [ { "@id": "http://www.w3.org/2001/XMLSchema#dateTime" @@ -132,7 +146,9 @@ }, { "@id": "_:genid19", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -152,7 +168,9 @@ }, { "@id": "_:genid2", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#minQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -172,7 +190,9 @@ }, { "@id": "_:genid20", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.omg.org/spec/LCC/Countries/CountryRepresentation/Country" @@ -192,7 +212,9 @@ }, { "@id": "_:genid21", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -212,7 +234,9 @@ }, { "@id": "_:genid22", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -227,7 +251,9 @@ }, { "@id": "_:genid23", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -242,7 +268,9 @@ }, { "@id": "_:genid24", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -257,7 +285,9 @@ }, { "@id": "_:genid25", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -272,7 +302,9 @@ }, { "@id": "_:genid26", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -287,7 +319,9 @@ }, { "@id": "_:genid27", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -302,7 +336,9 @@ }, { "@id": "_:genid28", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -317,7 +353,9 @@ }, { "@id": "_:genid29", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -332,7 +370,9 @@ }, { "@id": "_:genid3", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/EntityStatus" @@ -352,7 +392,9 @@ }, { "@id": "_:genid30", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -367,7 +409,9 @@ }, { "@id": "_:genid31", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -387,7 +431,9 @@ }, { "@id": "_:genid32", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#onProperty": [ { "@id": "https://www.gleif.org/ontology/Base/isRegisteredIn" @@ -401,7 +447,9 @@ }, { "@id": "_:genid33", - "@type": ["http://www.w3.org/2002/07/owl#AllDifferent"], + "@type": [ + "http://www.w3.org/2002/07/owl#AllDifferent" + ], "http://www.w3.org/2002/07/owl#distinctMembers": [ { "@list": [ @@ -420,7 +468,9 @@ }, { "@id": "_:genid37", - "@type": ["http://www.w3.org/2002/07/owl#AllDifferent"], + "@type": [ + "http://www.w3.org/2002/07/owl#AllDifferent" + ], "http://www.w3.org/2002/07/owl#distinctMembers": [ { "@list": [ @@ -436,7 +486,9 @@ }, { "@id": "_:genid4", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -456,7 +508,9 @@ }, { "@id": "_:genid5", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -471,7 +525,9 @@ }, { "@id": "_:genid6", - "@type": ["http://www.w3.org/2002/07/owl#Restriction"], + "@type": [ + "http://www.w3.org/2002/07/owl#Restriction" + ], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -491,7 +547,9 @@ }, { "@id": "_:genid7", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2002/07/owl#oneOf": [ { "@list": [ @@ -510,27 +568,39 @@ }, { "@id": "http://purl.org/dc/terms/created", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"] + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ] }, { "@id": "http://purl.org/dc/terms/modified", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"] + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ] }, { "@id": "http://purl.org/dc/terms/rightsHolder", - "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] + "@type": [ + "http://www.w3.org/2002/07/owl#AnnotationProperty" + ] }, { "@id": "http://purl.org/vocab/vann/preferredNamespacePrefix", - "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] + "@type": [ + "http://www.w3.org/2002/07/owl#AnnotationProperty" + ] }, { "@id": "http://purl.org/vocab/vann/preferredNamespaceUri", - "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] + "@type": [ + "http://www.w3.org/2002/07/owl#AnnotationProperty" + ] }, { "@id": "http://purl.org/vocommons/voaf#Vocabulary", - "@type": ["http://www.w3.org/2002/07/owl#Class"] + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ] }, { "@id": "https://www.gleif.org/ontology/Base/", @@ -624,7 +694,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Entity", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -663,7 +735,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/EntityExpirationReason", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -768,7 +842,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/EntityStatus", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -869,7 +945,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Identifier", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -896,7 +974,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/LegalEntityRelationship", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -923,7 +1003,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/LegalPerson", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -947,7 +1029,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Period", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -975,7 +1059,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1035,7 +1121,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddressASCII", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1059,7 +1147,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistrationAuthority", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1093,7 +1183,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistrationStatus", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1112,7 +1204,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Registry", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1136,7 +1230,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistryEntry", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1155,7 +1251,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistryIdentifier", - "@type": ["http://www.w3.org/2002/07/owl#Class"], + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1209,7 +1307,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAbbreviationLocal", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1233,7 +1333,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAbbreviationTransliterated", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1257,7 +1359,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAdditionalAddressLine", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1281,7 +1385,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddress", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1310,7 +1416,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressHeadquarters", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1334,7 +1442,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLegal", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1358,7 +1468,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine1", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1387,7 +1499,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine2", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1416,7 +1530,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine3", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1450,7 +1566,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine4", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1484,7 +1602,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressNumber", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1508,7 +1628,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressNumberWithinBuilding", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1532,7 +1654,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressTransliterated", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1561,7 +1685,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasCity", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1585,7 +1711,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasCountry", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1619,7 +1747,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasCoverageArea", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1643,7 +1773,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasEnd", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Period" @@ -1673,7 +1805,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasEntityExpirationDate", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1702,7 +1836,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasEntityExpirationReason", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1763,7 +1899,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasFirstAddressLine", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1787,7 +1925,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasGeographicRegion", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1811,7 +1951,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasInitialRegistrationDate", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1840,7 +1982,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasLastUpdateDate", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1869,7 +2013,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasLegalJurisdiction", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1898,11 +2044,15 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasLegalName", - "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] + "@type": [ + "http://www.w3.org/2002/07/owl#AnnotationProperty" + ] }, { "@id": "https://www.gleif.org/ontology/Base/hasMailRouting", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1953,7 +2103,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameASCII", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1987,7 +2139,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameASCIIAutomatic", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2024,7 +2178,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameASCIIPreferred", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2101,7 +2257,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameAdditionalLocal", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2128,7 +2286,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameLegal", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2205,7 +2365,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameLocal", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2239,7 +2401,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNamePreviousLegal", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/base/" @@ -2263,7 +2427,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameTradingOrOperating", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/base/" @@ -2309,7 +2475,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameTranslatedEnglish", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2389,7 +2557,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNextRenewalDate", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2413,7 +2583,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasPostalCode", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -2437,7 +2609,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasRegion", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2538,7 +2712,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasStart", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Period" @@ -2568,7 +2744,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasSuccessor", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -2597,7 +2775,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasSuccessorName", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -2685,7 +2865,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasWebsite", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2731,7 +2913,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isManagedBy", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2750,7 +2934,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isQualifiedBy", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/LegalEntityRelationship" @@ -2774,7 +2960,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isQuantifiedBy", - "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#DatatypeProperty" + ], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/LegalEntityRelationship" @@ -2803,7 +2991,9 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isRegisteredIn", - "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], + "@type": [ + "http://www.w3.org/2002/07/owl#ObjectProperty" + ], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2854,6 +3044,8 @@ }, { "@id": "https://www.omg.org/spec/LCC/Countries/CountryRepresentation/Region", - "@type": ["http://www.w3.org/2002/07/owl#Class"] + "@type": [ + "http://www.w3.org/2002/07/owl#Class" + ] } ] diff --git a/spec_configs/lei.json b/spec_configs/lei.json index a2c5575..188a6b3 100644 --- a/spec_configs/lei.json +++ b/spec_configs/lei.json @@ -1,8 +1,12 @@ [ { - "LEI": { "$": "254900C9UJMDGJ0ILK56" }, + "LEI": { + "$": "254900C9UJMDGJ0ILK56" + }, "Entity": { - "LegalName": { "$": "FreightTrust and Clearing, Inc." }, + "LegalName": { + "$": "FreightTrust and Clearing, Inc." + }, "OtherEntityNames": { "OtherEntityName": [ { @@ -12,42 +16,98 @@ ] }, "LegalAddress": { - "FirstAddressLine": { "$": "c/o ROCKET LAWYER CORPORATE SERVICES LLC" }, + "FirstAddressLine": { + "$": "c/o ROCKET LAWYER CORPORATE SERVICES LLC" + }, "AdditionalAddressLine": [ - { "$": "2035 SUNSET LAKE RD" }, - { "$": "SUITE B-2" } + { + "$": "2035 SUNSET LAKE RD" + }, + { + "$": "SUITE B-2" + } ], - "City": { "$": "NEWARK" }, - "Region": { "$": "US-DE" }, - "Country": { "$": "US" }, - "PostalCode": { "$": "19702" } + "City": { + "$": "NEWARK" + }, + "Region": { + "$": "US-DE" + }, + "Country": { + "$": "US" + }, + "PostalCode": { + "$": "19702" + } }, "HeadquartersAddress": { - "FirstAddressLine": { "$": "1424 4th St Ste 214" }, - "AdditionalAddressLine": [{ "$": "PMB 1513" }], - "City": { "$": "Santa Monica" }, - "Region": { "$": "US-CA" }, - "Country": { "$": "US" }, - "PostalCode": { "$": "90401" } + "FirstAddressLine": { + "$": "1424 4th St Ste 214" + }, + "AdditionalAddressLine": [ + { + "$": "PMB 1513" + } + ], + "City": { + "$": "Santa Monica" + }, + "Region": { + "$": "US-CA" + }, + "Country": { + "$": "US" + }, + "PostalCode": { + "$": "90401" + } }, "RegistrationAuthority": { - "RegistrationAuthorityID": { "$": "RA000602" }, - "RegistrationAuthorityEntityID": { "$": "7650005" } + "RegistrationAuthorityID": { + "$": "RA000602" + }, + "RegistrationAuthorityEntityID": { + "$": "7650005" + } }, - "LegalJurisdiction": { "$": "US-DE" }, - "LegalForm": { "EntityLegalFormCode": { "$": "XTIQ" } }, - "EntityStatus": { "$": "ACTIVE" } + "LegalJurisdiction": { + "$": "US-DE" + }, + "LegalForm": { + "EntityLegalFormCode": { + "$": "XTIQ" + } + }, + "EntityStatus": { + "$": "ACTIVE" + } }, "Registration": { - "InitialRegistrationDate": { "$": "2020-05-11T11:47:13.761Z" }, - "LastUpdateDate": { "$": "2020-05-11T11:47:13.761Z" }, - "RegistrationStatus": { "$": "ISSUED" }, - "NextRenewalDate": { "$": "2021-05-11T11:47:13.761Z" }, - "ManagingLOU": { "$": "5493001KJTIIGC8Y1R12" }, - "ValidationSources": { "$": "FULLY_CORROBORATED" }, + "InitialRegistrationDate": { + "$": "2020-05-11T11:47:13.761Z" + }, + "LastUpdateDate": { + "$": "2020-05-11T11:47:13.761Z" + }, + "RegistrationStatus": { + "$": "ISSUED" + }, + "NextRenewalDate": { + "$": "2021-05-11T11:47:13.761Z" + }, + "ManagingLOU": { + "$": "5493001KJTIIGC8Y1R12" + }, + "ValidationSources": { + "$": "FULLY_CORROBORATED" + }, "ValidationAuthority": { - "ValidationAuthorityID": { "$": "RA000602" }, - "ValidationAuthorityEntityID": { "$": "7650005" } + "ValidationAuthorityID": { + "$": "RA000602" + }, + "ValidationAuthorityEntityID": { + "$": "7650005" + } } } } diff --git a/spec_trade/event_orderProcessed.json b/spec_trade/event_orderProcessed.json index 111e443..71ed4d6 100644 --- a/spec_trade/event_orderProcessed.json +++ b/spec_trade/event_orderProcessed.json @@ -1,5 +1,7 @@ { "action": "update", "type": "order_processed", - "data": { "id": "ft7717d4-04e9-4430-a21b-08d32b2c340x" } + "data": { + "id": "ft7717d4-04e9-4430-a21b-08d32b2c340x" + } } diff --git a/spec_user_entity/entityType.json b/spec_user_entity/entityType.json index d8fe93e..4bddd40 100644 --- a/spec_user_entity/entityType.json +++ b/spec_user_entity/entityType.json @@ -1,4 +1,4 @@ -[ +[ { "typeID": 1, "entityType": "CargoInterest", @@ -94,7 +94,11 @@ "entityType": "RegularBroker", "entityTypeDescription": "BookingagentwhoislicensedbythegovernmentintheirjurisdictiontobookcargoasdefinedbyFMCSA" }, - { "typeID": 20, "entityType": "Agent", "entityTypeDescription": "Agent" }, + { + "typeID": 20, + "entityType": "Agent", + "entityTypeDescription": "Agent" + }, { "typeID": 21, "entityType": "3rdParty", From 8ff3c657c756439b2b17534c1c946ebdbfb3cbf4 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 Jul 2020 18:34:24 +0000 Subject: [PATCH 3/6] Restyled by prettier-json --- ROOT/BOLWorkflow.json | 25 +-- ROOT/BillOfLadingModel.json | 20 +- ROOT/SpecialServicesCode.json | 8 +- napp.json | 190 ++++------------- spec_configs/lei-jsonld.json | 384 +++++++++------------------------- 5 files changed, 141 insertions(+), 486 deletions(-) diff --git a/ROOT/BOLWorkflow.json b/ROOT/BOLWorkflow.json index 7f56876..7cc229b 100644 --- a/ROOT/BOLWorkflow.json +++ b/ROOT/BOLWorkflow.json @@ -16,22 +16,10 @@ "format": "uri", "type": "string", "description": "pki", - "enum": [ - "notify", - "notifyAll", - "getClass", - "finalize" - ] + "enum": ["notify", "notifyAll", "getClass", "finalize"] }, "GoverningLaw": { - "enum": [ - "MASTER_AGREEMENT", - "USCA", - "USDE", - "USIL", - "USNY", - "OTHER" - ], + "enum": ["MASTER_AGREEMENT", "USCA", "USDE", "USIL", "USNY", "OTHER"], "type": "string" }, "Cosignee": { @@ -59,16 +47,11 @@ "additionalProperties": { "format": null, "type": "object", - "required": [ - "checksum_digit" - ] + "required": ["checksum_digit"] } }, "AssetClass": { - "enum": [ - null, - null - ], + "enum": [null, null], "type": "string", "items": { "enum": null, diff --git a/ROOT/BillOfLadingModel.json b/ROOT/BillOfLadingModel.json index 4b549f0..8ccdcaf 100644 --- a/ROOT/BillOfLadingModel.json +++ b/ROOT/BillOfLadingModel.json @@ -16,22 +16,10 @@ "format": "uri", "type": "string", "description": "pki", - "enum": [ - "notify", - "notifyAll", - "getClass", - "finalize" - ] + "enum": ["notify", "notifyAll", "getClass", "finalize"] }, "GoverningLaw": { - "enum": [ - "MASTER_AGREEMENT", - "USCA", - "USDE", - "USIL", - "USNY", - "OTHER" - ], + "enum": ["MASTER_AGREEMENT", "USCA", "USDE", "USIL", "USNY", "OTHER"], "type": "string" }, "Cosignee": { @@ -59,9 +47,7 @@ "additionalProperties": { "format": null, "type": "object", - "required": [ - "checksum_digit" - ] + "required": ["checksum_digit"] } } } diff --git a/ROOT/SpecialServicesCode.json b/ROOT/SpecialServicesCode.json index 59f996c..3e6f187 100644 --- a/ROOT/SpecialServicesCode.json +++ b/ROOT/SpecialServicesCode.json @@ -13,13 +13,9 @@ "ID": "Inside Delivery", "ZZ": "Mutually Defined" }, - "required": [ - "SpecialServicesCode" - ], + "required": ["SpecialServicesCode"], "dependencies": { - "": [ - "" - ] + "": [""] } } } diff --git a/napp.json b/napp.json index f567163..f24d3d8 100644 --- a/napp.json +++ b/napp.json @@ -26,9 +26,7 @@ "operationId": "submitPayment", "description": "Payment initiation request related to a single credit transfer between a debtor and creditor.", "summary": "Submit Payment.", - "tags": [ - "REST API" - ], + "tags": ["REST API"], "parameters": [ { "name": "x-Correlation-Id", @@ -202,9 +200,7 @@ "operationId": "getPaymentStatus", "description": "Request sent by a OSP (Overlay Service Provider) in order to get the status of a given transaction.", "summary": "Get Payment Status.", - "tags": [ - "REST API" - ], + "tags": ["REST API"], "parameters": [ { "in": "path", @@ -366,9 +362,7 @@ "operationId": "getAccountServicerByAlias", "description": "Request to get the account servicer details for a given alias.", "summary": "Get Account Servicer By Alias.", - "tags": [ - "REST API" - ], + "tags": ["REST API"], "parameters": [ { "in": "query", @@ -377,12 +371,7 @@ "required": true, "schema": { "type": "string", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ] + "enum": ["TELI", "EMAL", "AUBN", "ORGN"] } }, { @@ -545,9 +534,7 @@ "operationId": "submitCancelPayment", "description": "This API allows a NPP Participant client (customer or Overlay Service Provider) to request the NPP Participant to return a previously submitted payment.", "summary": "Submit Cancel Payment.", - "tags": [ - "REST API" - ], + "tags": ["REST API"], "parameters": [ { "name": "x-Correlation-Id", @@ -721,9 +708,7 @@ "operationId": "submitReturnPayment", "description": "This API allows a NPP Participant client (customer or Overlay Service Provider) to request the NPP Participant to return a previously received payment.", "summary": "Submit Return Payment.", - "tags": [ - "REST API" - ], + "tags": ["REST API"], "parameters": [ { "name": "x-Correlation-Id", @@ -897,9 +882,7 @@ "operationId": "getPaymentEventDetails", "description": "Allows a NPP client (customer or Overlay Service Provider) to fetch from the NPP Participant details of a debit or credit to their account (e.g. under a API call-back arrangement).", "summary": "Get Payment Event Details.", - "tags": [ - "REST API" - ], + "tags": ["REST API"], "parameters": [ { "in": "path", @@ -1085,10 +1068,7 @@ "properties": { "severity": { "type": "string", - "enum": [ - "Fatal", - "Transient" - ] + "enum": ["Fatal", "Transient"] }, "code": { "type": "string", @@ -1123,16 +1103,10 @@ "type": "string" } }, - "required": [ - "severity", - "code", - "text" - ] + "required": ["severity", "code", "text"] } }, - "required": [ - "status" - ] + "required": ["status"] }, "AccountAliasResource": { "type": "object", @@ -1141,12 +1115,7 @@ "alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian\r\nBusiness Number.", "type": "string", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "TELI" }, "alias_value": { @@ -1180,10 +1149,7 @@ "example": "ADDR.API.0405 Alias Identifier in use" } }, - "required": [ - "alias_type", - "alias_value" - ], + "required": ["alias_type", "alias_value"], "example": { "alias_type": "TELI", "alias_value": "+61-4123456789", @@ -1232,10 +1198,7 @@ "instruction_priority": { "description": "Indicator of the urgency or order of importance that the instructing party would like the instructed party to apply to the processing of the instruction.", "type": "string", - "enum": [ - "HIGH", - "NORM" - ], + "enum": ["HIGH", "NORM"], "example": "NORM" }, "service_level": { @@ -1271,12 +1234,7 @@ "debtor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business\r\nNumber.", "type": "string", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "TELI" }, "debtor_alias_value": { @@ -1296,10 +1254,7 @@ "debtor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", "type": "string", - "enum": [ - "BBAN", - "AIIN" - ], + "enum": ["BBAN", "AIIN"], "example": "BBAN" }, "debtor_agent_bic": { @@ -1321,12 +1276,7 @@ "creditor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business\r\nNumber.", "type": "string", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "TELI" }, "creditor_alias_value": { @@ -1346,10 +1296,7 @@ "creditor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", "type": "string", - "enum": [ - "BBAN", - "AIIN" - ], + "enum": ["BBAN", "AIIN"], "example": "BBAN" }, "creditor_agent_bic": { @@ -1429,10 +1376,7 @@ "remiitance_referred_document_type": "CINV", "remittance_referred_document_number": "INV-12345678", "remittance_referred_related_date": "2018-08-23", - "remittance_information_unstructured": [ - "FIRST LINE", - "SECOND LINE" - ] + "remittance_information_unstructured": ["FIRST LINE", "SECOND LINE"] } }, "PaymentCancellationRequest": { @@ -1492,12 +1436,7 @@ "debtor_alias_type": { "type": "string", "description": "Specifies the type of alias identifier, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "TELI" }, "debtor_alias_value": { @@ -1517,10 +1456,7 @@ "debtor_account_type": { "type": "string", "description": "Name of the account identification identification scheme, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": [ - "BBAN", - "AIIN" - ], + "enum": ["BBAN", "AIIN"], "example": "BBAN" }, "original_creditor_name": { @@ -1533,12 +1469,7 @@ "creditor_alias_type": { "type": "string", "description": "Specifies the type of alias identifier, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "TELI" }, "creditor_alias_value": { @@ -1558,10 +1489,7 @@ "creditor_account_type": { "type": "string", "description": "Name of the account identification identification scheme, in a coded form as published in an external list. The same value may have been provided in the original payment instruction.", - "enum": [ - "BBAN", - "AIIN" - ], + "enum": ["BBAN", "AIIN"], "example": "BBAN" } }, @@ -1591,9 +1519,7 @@ "example": "Case 12345678" } }, - "required": [ - "acceptance_date_time" - ] + "required": ["acceptance_date_time"] }, "PaymentReturnResource": { "type": "object", @@ -1707,9 +1633,7 @@ "example": "43ba8cc0-67ff-490f-abe5-5bb640bc3681" } }, - "required": [ - "notification_identification" - ] + "required": ["notification_identification"] }, "PaymentEventResponseResource": { "type": "object", @@ -1753,20 +1677,13 @@ "credit_debit_indicator": { "description": "Indicates whether the entry is a credit or a debit entry.", "type": "string", - "enum": [ - "CRDT", - "DBIT" - ], + "enum": ["CRDT", "DBIT"], "example": "CRDT" }, "status": { "description": "Status of an entry on the books of the account servicer.", "type": "string", - "enum": [ - "BOOK", - "PDNG", - "INFO" - ], + "enum": ["BOOK", "PDNG", "INFO"], "example": "CRDT" }, "booking_date_time": { @@ -1830,12 +1747,7 @@ "debtor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business\r\nNumber.", "type": "string", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "EMAL" }, "debtor_alias_value": { @@ -1855,10 +1767,7 @@ "debtor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", "type": "string", - "enum": [ - "BBAN", - "AIIN" - ], + "enum": ["BBAN", "AIIN"], "example": "BBAN" }, "debtor_agent_bic": { @@ -1881,12 +1790,7 @@ "creditor_alias_type": { "description": "Contains the type of Alias Identifier. E.g. an email, a phone number or an Australian Business Number.", "type": "string", - "enum": [ - "TELI", - "EMAL", - "AUBN", - "ORGN" - ], + "enum": ["TELI", "EMAL", "AUBN", "ORGN"], "example": "EMAL" }, "creditor_alias_value": { @@ -1905,10 +1809,7 @@ }, "creditor_account_type": { "description": "Name of the account identification identification scheme, in a coded form as published in an external list.", - "enum": [ - "BBAN", - "AIIN" - ], + "enum": ["BBAN", "AIIN"], "example": "BBAN" }, "remittance_referred_document_type": { @@ -1963,10 +1864,7 @@ }, "credit_debit_indicator": { "type": "string", - "enum": [ - "CRDT", - "DBIT" - ], + "enum": ["CRDT", "DBIT"], "example": "CRDT" }, "charge_included_indicator": { @@ -1988,12 +1886,7 @@ "bearer": { "type": "string", "description": "Specifies which party(ies) will pay charges due for processing of the instruction.", - "enum": [ - "DEBT", - "CRED", - "SHAR", - "SLEV" - ], + "enum": ["DEBT", "CRED", "SHAR", "SLEV"], "example": "SLEV" }, "tax_identification": { @@ -2013,9 +1906,7 @@ "$ref": "#/components/schemas/ActiveOrHistoricCurrencyAndAmount" } }, - "required": [ - "amount" - ] + "required": ["amount"] }, "ActiveOrHistoricCurrencyAndAmount": { "type": "object", @@ -2030,10 +1921,7 @@ "example": 562.89 } }, - "required": [ - "currency", - "amount" - ] + "required": ["currency", "amount"] }, "ActiveOrHistoricCurrencyCode": { "type": "string", @@ -2048,11 +1936,7 @@ "transaction_status": { "description": "Specifies the status of a transaction, in a coded form.", "type": "string", - "enum": [ - "ACCP", - "ACSC", - "RJCT" - ], + "enum": ["ACCP", "ACSC", "RJCT"], "example": "ACCP" }, "transaction_status_reason_code": { @@ -2088,9 +1972,7 @@ "example": "3F2504E0-4F89-11D3-9A0C-0305E82C3301" } }, - "required": [ - "transaction_status" - ], + "required": ["transaction_status"], "example": { "transaction_status": "RJCT", "transaction_status_reason_code": "AC01", diff --git a/spec_configs/lei-jsonld.json b/spec_configs/lei-jsonld.json index c9cc1c0..6fd01b2 100644 --- a/spec_configs/lei-jsonld.json +++ b/spec_configs/lei-jsonld.json @@ -1,9 +1,7 @@ [ { "@id": "_:genid1", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#minQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -23,9 +21,7 @@ }, { "@id": "_:genid11", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2002/07/owl#oneOf": [ { "@list": [ @@ -41,9 +37,7 @@ }, { "@id": "_:genid14", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -58,9 +52,7 @@ }, { "@id": "_:genid15", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onDataRange": [ { "@id": "http://www.w3.org/2001/XMLSchema#string" @@ -80,9 +72,7 @@ }, { "@id": "_:genid16", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -102,9 +92,7 @@ }, { "@id": "_:genid17", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -124,9 +112,7 @@ }, { "@id": "_:genid18", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onDataRange": [ { "@id": "http://www.w3.org/2001/XMLSchema#dateTime" @@ -146,9 +132,7 @@ }, { "@id": "_:genid19", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -168,9 +152,7 @@ }, { "@id": "_:genid2", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#minQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -190,9 +172,7 @@ }, { "@id": "_:genid20", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.omg.org/spec/LCC/Countries/CountryRepresentation/Country" @@ -212,9 +192,7 @@ }, { "@id": "_:genid21", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -234,9 +212,7 @@ }, { "@id": "_:genid22", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -251,9 +227,7 @@ }, { "@id": "_:genid23", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -268,9 +242,7 @@ }, { "@id": "_:genid24", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -285,9 +257,7 @@ }, { "@id": "_:genid25", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -302,9 +272,7 @@ }, { "@id": "_:genid26", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -319,9 +287,7 @@ }, { "@id": "_:genid27", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -336,9 +302,7 @@ }, { "@id": "_:genid28", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -353,9 +317,7 @@ }, { "@id": "_:genid29", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -370,9 +332,7 @@ }, { "@id": "_:genid3", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/EntityStatus" @@ -392,9 +352,7 @@ }, { "@id": "_:genid30", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -409,9 +367,7 @@ }, { "@id": "_:genid31", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onClass": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -431,9 +387,7 @@ }, { "@id": "_:genid32", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#onProperty": [ { "@id": "https://www.gleif.org/ontology/Base/isRegisteredIn" @@ -447,9 +401,7 @@ }, { "@id": "_:genid33", - "@type": [ - "http://www.w3.org/2002/07/owl#AllDifferent" - ], + "@type": ["http://www.w3.org/2002/07/owl#AllDifferent"], "http://www.w3.org/2002/07/owl#distinctMembers": [ { "@list": [ @@ -468,9 +420,7 @@ }, { "@id": "_:genid37", - "@type": [ - "http://www.w3.org/2002/07/owl#AllDifferent" - ], + "@type": ["http://www.w3.org/2002/07/owl#AllDifferent"], "http://www.w3.org/2002/07/owl#distinctMembers": [ { "@list": [ @@ -486,9 +436,7 @@ }, { "@id": "_:genid4", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -508,9 +456,7 @@ }, { "@id": "_:genid5", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#cardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -525,9 +471,7 @@ }, { "@id": "_:genid6", - "@type": [ - "http://www.w3.org/2002/07/owl#Restriction" - ], + "@type": ["http://www.w3.org/2002/07/owl#Restriction"], "http://www.w3.org/2002/07/owl#maxQualifiedCardinality": [ { "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger", @@ -547,9 +491,7 @@ }, { "@id": "_:genid7", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2002/07/owl#oneOf": [ { "@list": [ @@ -568,39 +510,27 @@ }, { "@id": "http://purl.org/dc/terms/created", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ] + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"] }, { "@id": "http://purl.org/dc/terms/modified", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ] + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"] }, { "@id": "http://purl.org/dc/terms/rightsHolder", - "@type": [ - "http://www.w3.org/2002/07/owl#AnnotationProperty" - ] + "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] }, { "@id": "http://purl.org/vocab/vann/preferredNamespacePrefix", - "@type": [ - "http://www.w3.org/2002/07/owl#AnnotationProperty" - ] + "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] }, { "@id": "http://purl.org/vocab/vann/preferredNamespaceUri", - "@type": [ - "http://www.w3.org/2002/07/owl#AnnotationProperty" - ] + "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] }, { "@id": "http://purl.org/vocommons/voaf#Vocabulary", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ] + "@type": ["http://www.w3.org/2002/07/owl#Class"] }, { "@id": "https://www.gleif.org/ontology/Base/", @@ -694,9 +624,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Entity", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -735,9 +663,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/EntityExpirationReason", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -842,9 +768,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/EntityStatus", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -945,9 +869,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Identifier", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -974,9 +896,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/LegalEntityRelationship", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1003,9 +923,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/LegalPerson", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1029,9 +947,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Period", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1059,9 +975,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1121,9 +1035,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddressASCII", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1147,9 +1059,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistrationAuthority", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1183,9 +1093,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistrationStatus", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1204,9 +1112,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/Registry", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1230,9 +1136,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistryEntry", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1251,9 +1155,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/RegistryIdentifier", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ], + "@type": ["http://www.w3.org/2002/07/owl#Class"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1307,9 +1209,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAbbreviationLocal", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1333,9 +1233,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAbbreviationTransliterated", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1359,9 +1257,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAdditionalAddressLine", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1385,9 +1281,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddress", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1416,9 +1310,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressHeadquarters", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1442,9 +1334,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLegal", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1468,9 +1358,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine1", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1499,9 +1387,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine2", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1530,9 +1416,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine3", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1566,9 +1450,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressLine4", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1602,9 +1484,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressNumber", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1628,9 +1508,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressNumberWithinBuilding", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1654,9 +1532,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasAddressTransliterated", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1685,9 +1561,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasCity", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1711,9 +1585,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasCountry", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1747,9 +1619,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasCoverageArea", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1773,9 +1643,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasEnd", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Period" @@ -1805,9 +1673,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasEntityExpirationDate", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1836,9 +1702,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasEntityExpirationReason", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -1899,9 +1763,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasFirstAddressLine", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -1925,9 +1787,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasGeographicRegion", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1951,9 +1811,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasInitialRegistrationDate", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -1982,9 +1840,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasLastUpdateDate", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2013,9 +1869,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasLegalJurisdiction", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -2044,15 +1898,11 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasLegalName", - "@type": [ - "http://www.w3.org/2002/07/owl#AnnotationProperty" - ] + "@type": ["http://www.w3.org/2002/07/owl#AnnotationProperty"] }, { "@id": "https://www.gleif.org/ontology/Base/hasMailRouting", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -2103,9 +1953,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameASCII", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2139,9 +1987,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameASCIIAutomatic", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2178,9 +2024,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameASCIIPreferred", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2257,9 +2101,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameAdditionalLocal", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2286,9 +2128,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameLegal", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2365,9 +2205,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameLocal", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2401,9 +2239,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNamePreviousLegal", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/base/" @@ -2427,9 +2263,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameTradingOrOperating", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/base/" @@ -2475,9 +2309,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNameTranslatedEnglish", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2557,9 +2389,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasNextRenewalDate", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2583,9 +2413,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasPostalCode", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/PhysicalAddress" @@ -2609,9 +2437,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasRegion", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2712,9 +2538,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasStart", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Period" @@ -2744,9 +2568,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasSuccessor", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -2775,9 +2597,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasSuccessorName", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/Entity" @@ -2865,9 +2685,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/hasWebsite", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2913,9 +2731,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isManagedBy", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -2934,9 +2750,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isQualifiedBy", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/LegalEntityRelationship" @@ -2960,9 +2774,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isQuantifiedBy", - "@type": [ - "http://www.w3.org/2002/07/owl#DatatypeProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#DatatypeProperty"], "http://www.w3.org/2000/01/rdf-schema#domain": [ { "@id": "https://www.gleif.org/ontology/Base/LegalEntityRelationship" @@ -2991,9 +2803,7 @@ }, { "@id": "https://www.gleif.org/ontology/Base/isRegisteredIn", - "@type": [ - "http://www.w3.org/2002/07/owl#ObjectProperty" - ], + "@type": ["http://www.w3.org/2002/07/owl#ObjectProperty"], "http://www.w3.org/2000/01/rdf-schema#isDefinedBy": [ { "@id": "https://www.gleif.org/ontology/Base/" @@ -3044,8 +2854,6 @@ }, { "@id": "https://www.omg.org/spec/LCC/Countries/CountryRepresentation/Region", - "@type": [ - "http://www.w3.org/2002/07/owl#Class" - ] + "@type": ["http://www.w3.org/2002/07/owl#Class"] } ] From 4e84d9b02e0db9924e8afa858d75fcd5e6b8995c Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 Jul 2020 18:34:25 +0000 Subject: [PATCH 4/6] Restyled by prettier-markdown --- README.md | 39 +++++++++++++++++++++------------------ etc/README.md | 14 +++++++++----- etc/lei/README.md | 14 +++++++++----- smart_contracts/era.md | 12 ++++++++---- 4 files changed, 47 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 5bfd01f..2d29d94 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,18 @@ Trades & Orders --> # Protocol Spec -For ABNF specs, [see the `spec_abnf` dir](https://github.com/freight-trust/protocol/tree/master/spec_abnf/abnf) +For ABNF specs, +[see the `spec_abnf` dir](https://github.com/freight-trust/protocol/tree/master/spec_abnf/abnf) - directories with `spec_*` are the reference specification -- directories with `lib` or `module`/`component` _should_ be the technical implementation +- directories with `lib` or `module`/`component` _should_ be the technical + implementation ### Interfaces Freight Trust Network Interface -
+ style="float: left; margin-right: 10px;" />
### Documents of Trade @@ -45,27 +46,29 @@ For ABNF specs, [see the `spec_abnf` dir](https://github.com/freight-trust/proto - Units of Efferent - Units of Lexigram -* Controlled Natural Language = Jurisdictional Grammar (see [Burgess](https://github.com/freight-trust/burgess) ) +* Controlled Natural Language = Jurisdictional Grammar (see + [Burgess](https://github.com/freight-trust/burgess) ) * Afferent = Towards * Efferent = Away ## Blocks as `units of agreement` -A couple of specific block linkages are stated as facts. Two general principles of block chaining based on such linkages are stated as "conclusion if condition" rules. (The diagrams' color coding is extended to the symbolic form by using green for facts and their rule-condition counterparts while using red for rule conclusions and their -- recursive -- rule-condition counterpart.) +A couple of specific block linkages are stated as facts. Two general principles +of block chaining based on such linkages are stated as "conclusion if condition" +rules. (The diagrams' color coding is extended to the symbolic form by using +green for facts and their rule-condition counterparts while using red for rule +conclusions and their -- recursive -- rule-condition counterpart.) -Facts -"Block1 links to Block2." -"Block2 links to Block3." -Rules -"x chains to y if x links to y." -"x chains to z if x links to y and y chains to z." +Facts "Block1 links to Block2." "Block2 links to Block3." Rules "x chains to y +if x links to y." "x chains to z if x links to y and y chains to z." -Facts are _primitives_ (i.e. not containing variables) that apply -a predicate to arguments +Facts are _primitives_ (i.e. not containing variables) that apply a predicate to +arguments -to Block1 followed by Block2 and -to Block2 followed by Block3 +to Block1 followed by Block2 and to Block2 followed by Block3 -Rules are of the form `conclusion :- condition` (i.e. containing variables), with the Prolog-like (symbol) infix `":-"` corresponding to the above "if". +Rules are of the form `conclusion :- condition` (i.e. containing variables), +with the Prolog-like (symbol) infix `":-"` corresponding to the above "if". -This consittutes the extent of which RuleML is applied to the `TradeDocs` system, a basic primitive set for `rule-conditions` +This consittutes the extent of which RuleML is applied to the `TradeDocs` +system, a basic primitive set for `rule-conditions` diff --git a/etc/README.md b/etc/README.md index 68f8b6d..a824f00 100644 --- a/etc/README.md +++ b/etc/README.md @@ -1,6 +1,8 @@ # LEI Informative -curl --request GET 'https://leilookup.gleif.org/api/v2/leirecords?lei=254900C9UJMDGJ0ILK56' --header 'Content-Type: application/json' --data-raw '[]' +curl --request GET +'https://leilookup.gleif.org/api/v2/leirecords?lei=254900C9UJMDGJ0ILK56' +--header 'Content-Type: application/json' --data-raw '[]' ```json [ @@ -132,16 +134,18 @@ freighttrust.com. IN CAA 0 issue "sectigo.com" parse lei.bloomberg.com -search for... `
` +search for... +`
` let HashingOutput = Base64URL( Multihash(DATA, 'sha2-256') ); ### terms -`credentials`: [source](https://www.w3.org/TR/vc-data-model/#dfn-verifiable-credentials) +`credentials`: +[source](https://www.w3.org/TR/vc-data-model/#dfn-verifiable-credentials) -`derived predicate` -A verifiable, boolean assertion about the value of another attribute in a verifiable credential. +`derived predicate` A verifiable, boolean assertion about the value of another +attribute in a verifiable credential. ## Minimal DID diff --git a/etc/lei/README.md b/etc/lei/README.md index 68f8b6d..a824f00 100644 --- a/etc/lei/README.md +++ b/etc/lei/README.md @@ -1,6 +1,8 @@ # LEI Informative -curl --request GET 'https://leilookup.gleif.org/api/v2/leirecords?lei=254900C9UJMDGJ0ILK56' --header 'Content-Type: application/json' --data-raw '[]' +curl --request GET +'https://leilookup.gleif.org/api/v2/leirecords?lei=254900C9UJMDGJ0ILK56' +--header 'Content-Type: application/json' --data-raw '[]' ```json [ @@ -132,16 +134,18 @@ freighttrust.com. IN CAA 0 issue "sectigo.com" parse lei.bloomberg.com -search for... `
` +search for... +`
` let HashingOutput = Base64URL( Multihash(DATA, 'sha2-256') ); ### terms -`credentials`: [source](https://www.w3.org/TR/vc-data-model/#dfn-verifiable-credentials) +`credentials`: +[source](https://www.w3.org/TR/vc-data-model/#dfn-verifiable-credentials) -`derived predicate` -A verifiable, boolean assertion about the value of another attribute in a verifiable credential. +`derived predicate` A verifiable, boolean assertion about the value of another +attribute in a verifiable credential. ## Minimal DID diff --git a/smart_contracts/era.md b/smart_contracts/era.md index 14f94a2..d8d556b 100644 --- a/smart_contracts/era.md +++ b/smart_contracts/era.md @@ -4,10 +4,14 @@ **Parameters:** -- \_domainHash `uint256`: _Keccak256 message digest of the domain to add or update._ -- \_domainAuthority `address`: _Contract to resolve sub-domains. This contract must implement this interface._ -- \_domainInfo `address`: _Contract which holds domain information for the domain name identified by_ -- \_domainOwner `address`: _Account entitled to update the \_domainAuthority or the \_domainInfo address for this domain_ +- \_domainHash `uint256`: _Keccak256 message digest of the domain to add or + update._ +- \_domainAuthority `address`: _Contract to resolve sub-domains. This contract + must implement this interface._ +- \_domainInfo `address`: _Contract which holds domain information for the + domain name identified by_ +- \_domainOwner `address`: _Account entitled to update the \_domainAuthority or + the \_domainInfo address for this domain_ ## removeDomain From d656564e782f2d2ee67239a55dc0f8e14d1d0bd5 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 Jul 2020 18:34:48 +0000 Subject: [PATCH 5/6] Restyled by prettier --- bin/pem.js | 39 +- protocol/index.js | 6 +- protocol/server.js | 18 +- protocol/validate-document.js | 61 +- spec_abnf/abnf/Rule5010270.js | 511 +++--- .../generateacknowledgement/enummap.js | 114 +- test_harness/generateacknowledgement/index.js | 63 +- test_harness/validatedocument/enummap.js | 114 +- test_harness/validatedocument/index.js | 63 +- test_harness/x12_test_harness/group.js | 211 +-- test_harness/x12_test_harness/schema.js | 48 +- test_harness/x12_test_harness/segment.js | 68 +- .../testFiles/835/profee-done.js | 1486 ++++++++--------- test_harness/x12_test_harness/x12grouper.js | 160 +- test_harness/x12_test_harness/x12parser.js | 116 +- 15 files changed, 1542 insertions(+), 1536 deletions(-) diff --git a/bin/pem.js b/bin/pem.js index 40ff401..05732e8 100644 --- a/bin/pem.js +++ b/bin/pem.js @@ -26,21 +26,21 @@ async function run() { // the message body let message = JSON.stringify({ - iss : "vendor", - sub : "1234", - exp : Date.now() + 10 * 60 * 1000, // expires in 10 minutes - iat : Date.now(), - bundle : "...", + iss: "vendor", + sub: "1234", + exp: Date.now() + 10 * 60 * 1000, // expires in 10 minutes + iat: Date.now(), + bundle: "...", }); // and signing options - let signoptions = {fields : {x5c : x5cChain}}; + let signoptions = { fields: { x5c: x5cChain } }; // sign 'message' with the 'privatekey', include the 'x5c' chain in the // headers let signed = await jose.JWS.createSign(signoptions, privatekey) - .update(message, "utf8") - .final(); + .update(message, "utf8") + .final(); // bet you didn't think it would be that big console.log(signed); @@ -89,8 +89,7 @@ run(); function verifySigningChain(cert, cacert) { return new Promise((resolve, reject) => { pem.verifySigningChain(cert, cacert, (err, ver) => { - if (err) - return reject(err); + if (err) return reject(err); return resolve(ver); }); }); @@ -112,7 +111,9 @@ function cert_to_x5c(cert, maxdepth) { */ cert = cert.replace(/-----[^\n]+\n?/gm, ",").replace(/\n/g, ""); - cert = cert.split(",").filter(function(c) { return c.length > 0; }); + cert = cert.split(",").filter(function (c) { + return c.length > 0; + }); if (maxdepth > 0) { cert = cert.splice(0, maxdepth); } @@ -121,13 +122,13 @@ function cert_to_x5c(cert, maxdepth) { function x5c_to_cert(x5c) { var cert, y; - cert = (function() { - var _i, _ref, _results; - _results = []; - for (y = _i = 0, _ref = x5c.length; _i <= _ref; y = _i += 64) { - _results.push(x5c.slice(y, +(y + 63) + 1 || 9e9)); - } - return _results; - })().join("\n"); + cert = (function () { + var _i, _ref, _results; + _results = []; + for (y = _i = 0, _ref = x5c.length; _i <= _ref; y = _i += 64) { + _results.push(x5c.slice(y, +(y + 63) + 1 || 9e9)); + } + return _results; + })().join("\n"); return "-----BEGIN CERTIFICATE-----\n" + cert + "\n-----END CERTIFICATE-----"; } diff --git a/protocol/index.js b/protocol/index.js index 4fdc92e..8f5f266 100644 --- a/protocol/index.js +++ b/protocol/index.js @@ -2,12 +2,12 @@ let fileLoader = new FreightTrustLib.EDIFileLoader(); fileLoader.AutoDetectDelimiters = true; let file = - "ISA*00* *00* *ZZ*133052274 *ZZ*311279999 *120419*2125*^*00501*000002120*0*P*<~GS*HC*133052274*311279999*20120419*212549*2120*X*005010X222A1~ST*837*000000533*005010X222A1~BHT*0019*00*000017120*20120419*212550*CH~NM1*41*2*CS*****46*133052274~PER*IC*CUSTOMER SOLUTIONS*TE*8008456592~NM1*40*2*RECEIVER*****46*311279999~HL*1**20*1~NM1*85*2*BILLING PROVIDER*****XX*1215954003~N3*1540 SUNDAY DRIVE~N4*RALEIGH*NC*276076000~REF*EI*569999999~NM1*87*2~N3*P O BOX 63146~N4*CHARLOTTE*NC*282633146~HL*2*1*22*0~SBR*P*18*******CI~NM1*IL*1*SMITH*JOHN****MI*505XXXX~N3*2345 NORTH RD~N4*SPRINGFIELD*NY*11111~DMG*D8*19950101*F~NM1*PR*2*BLUE CROSS*****PI*XX123A~N3*PO BOX 78765~N4*SOUTH BEACH*FL*23466~CLM*1029353-03*553.96***111[ST,M][BHT,M]{2000A:>1[HL*1,M]{2100A:1[NM1*4,M]}{2000B:>1[HL*2,M]{2100B:1[NM1*4,M][REF,O,9][N3][N4*1][PRV*1]}{2000C:>1[HL*2,M][TRN,O,2]{2100C:1[NM1*2,M][REF*1,O,9][N3][N4*1][PRV*1][DMG*1][INS*1][HI*1][DTP,O,2]{2110C:99[EQ*1][AMT*1][AMT*1][III][REF*1][DTP]}{2000D:>1[HL*2,X][TRN,O,2]{2100D:1[NM1*3,M][REF*1,O,9][N3][N4*3][PRV*1][DMG*1][INS*2][HI*1][DTP,O,2]{2110D:99[EQ*2,M][III][REF*1][DTP]}}}}}}}{END ST HEADER LOOP:1[SE,M]}}{END GS LOOP:1[GE,M]}}{END ISA LOOP:1[IEA,M]}}\n" + - "ELEMENT CODES\n" + - "101=1:1,00,03\n" + - "103=1:3,00,01\n" + - "105=1:5,01,14,20,27,28,29,30,33,ZZ*1:7,01,14,20,27,28,29,30,33,ZZ\n" + - "111=1:12,00501\n" + - "113=1:14,0,1\n" + - "114=1:15,P,T\n" + - "479=2:1,HS\n" + - "455=2:7,X\n" + - "480=2:8,005010X279A1\n" + - "143=3:1,270\n" + - "1705=3:3,005010X279A1\n" + - "1005=4:1,0022\n" + - "353=4:2,01,13\n" + - "640=4:6,RT\n" + - "735=5:3,20*7:3,21*13:3,22*30:3,23\n" + - "736=5:4,1*7:4,1*13:4,0,1*30:4,0\n" + - "98=6:1,2B,36,GP,P5,PR*8:1,1P,2B,36,80,FA,GP,P5,PR*15:1,IL*32:1,03\n" + - "1065=6:2,1,2*8:2,1,2*15:2,1,2*32:2,1\n" + - "66=6:8,24,46,FI,NI,PI,XV,XX*8:8,24,34,FI,PI,PP,SV,XV,XX*15:8,II,MI\n" + - "128=9:1,0B,1C,1D,1J,4A,CT,EL,EO,HPI,JD,N5,N7,Q4,SY,TJ*12:2,PXC*16:1,18,1L,1W,3H,6P,CT,EA,EJ,F6,GH,HJ,IG,N6,NQ,SY,Y4*19:2,9K,D3,EI,HPI,PXC,SY,TJ*28:1,9F,G1*33:1,18,1L,1W,6P,CT,EA,EJ,F6,GH,HJ,IF,IG,MRC,N6,SY,Y4*36:2,9K,D3,EI,HPI,PXC,SY,TJ*43:1,9F,G1\n" + - "1221=12:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SB,SK,SU*19:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU*36:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU\n" + - "481=14:1,1*31:1,1\n" + - "1250=20:1,D8*23:2,D8,RD8*29:2,D8,RD8*37:1,D8*40:2,D8,RD8*44:2,D8,RD8\n" + - "1068=20:3,F,M*37:3,F,M\n" + - "1073=21:1,Y*38:1,N\n" + - "1069=21:2,18*38:2,01,19,34\n" + - "1270=22:1:1,ABK,BK*22:2:1,ABF,BF*22:3:1,ABF,BF*22:4:1,ABF,BF*22:5:1,ABF,BF*22:6:1,ABF,BF*22:7:1,ABF,BF*22:8:1,ABF,BF*27:1,ZZ*39:1:1,ABK,BK*39:2:1,ABF,BF*39:3:1,ABF,BF*39:4:1,ABF,BF*39:5:1,ABF,BF*39:6:1,ABF,BF*39:7:1,ABF,BF*39:8:1,ABF,BF*42:1,BF,BK,ZZ\n" + - "374=23:1,102,291*29:1,291*40:1,102,291*44:1,291\n" + - "1365=24:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,B1,B2,B3,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,C1,CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM,CN,CO,CP,CQ,DG,DM,DS,GF,GN,GY,IC,MH,NI,ON,PT,PU,RN,RT,TC,TN,UC*41:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS\n" + - "235=24:2:1,AD,CJ,HC,ID,IV,N4,ZZ*41:2:1,AD,CJ,HC,ID,IV,N4,ZZ\n" + - "1207=24:3,FAM*41:3,CHD,DEP,ECH,EMP,ESP,FAM,IND,SPC,SPO\n" + - "522=25:1,R*26:1,PB\n" + - "1336=41:4,AP,C1,CO,HM,IP,OT,PR,PS,SP,WC\n" + - "ELEMENT FORMATS\n" + - "1251=20:2,0,,Date CCYYMMDD\n" + - "SUMMARY\n" + - "ELEMENT EQUALITY\n" + - "1:13=47:2\n" + - "3:2=45:2\n" + - "RULES\n" + - "24=13:4'EQ'0!USAGE!2!1\n" + - "30=13:4'EQ'1!USAGE!2!1\n" + - "ELEMENT COUNTERS\n" + - "ELEMENT CODE DESCRIPTION\n" + - "LOOP DESCRIPTIONS\n" + - "INTERCHANGE HEADER=START OF INTERCHANGE HEADER\n" + - "FUNCTIONAL GROUP=START OF FUNCTIONAL GROUP\n" + - "ST HEADER=START OF ST HEADER\n" + - "2000A=INFORMATION SOURCE LEVEL\n" + - "2100A=INFORMATION SOURCE NAME\n" + - "2000B=INFORMATION RECEIVER LEVEL\n" + - "2100B=INFORMATION RECEIVER NAME\n" + - "2000C=SUBSCRIBER LEVEL\n" + - "2100C=SUBSCRIBER NAME\n" + - "2110C=SUBSCRIBER ELIGIBILITY OR BENEFIT INQUIRY\n" + - "2000D=DEPENDENT LEVEL\n" + - "2100D=DEPENDENT NAME\n" + - "2110D=DEPENDENT ELIGIBILITY OR BENEFIT INQUIRY\n" + - "END ST HEADER LOOP=END ST HEADER LOOP\n" + - "END GS LOOP=END OF FUNCTIONAL HEADER\n" + - "END ISA LOOP=END OF INTERCHANGE HEADER\n" + - "SEGMENT DESCRIPTIONS\n" + - "ISA=1,Interchange Header\n" + - "GS=2,Functional Group\n" + - "ST=3,Transaction Set Header\n" + - "BHT=4,Beginning of Hierarchical Transaction\n" + - "HL=5,Information Source Level\n" + - "NM1=6,Information Source Name\n" + - "HL=7,Information Receiver Level\n" + - "NM1=8,Information Receiver Name\n" + - "REF=9,Information Receiver Additional Identification\n" + - "N3=10,Information Receiver Address\n" + - "N4=11,Information Receiver City\n" + - "PRV=12,Information Receiver Provider Information\n" + - "HL=13,Subscriber Level\n" + - "TRN=14,Subscriber Trace Number\n" + - "NM1=15,Subscriber Name\n" + - "REF=16,Subscriber Additional Identification\n" + - "N3=17,Subscriber Address\n" + - "N4=18,Subscriber City\n" + - "PRV=19,Provider Information\n" + - "DMG=20,Subscriber Demographic Information\n" + - "INS=21,Multiple Birth Sequence Number\n" + - "HI=22,Subscriber Health Care Diagnosis Code\n" + - "DTP=23,Subscriber Date\n" + - "EQ=24,Subscriber Eligibility or Benefit Inquiry\n" + - "AMT=25,Subscriber Spend Down Amount\n" + - "AMT=26,Subscriber Spend Down Total Billed Amount\n" + - "III=27,Subscriber Eligibility or Benefit Additional Inquiry Information\n" + - "REF=28,Subscriber Additional Information\n" + - "DTP=29,Subscriber Eligibility/Benefit Date\n" + - "HL=30,Dependent Level\n" + - "TRN=31,Dependent Trace Number\n" + - "NM1=32,Dependent Name\n" + - "REF=33,Dependent Additional Identification\n" + - "N3=34,Dependent Address\n" + - "N4=35,Dependent City\n" + - "PRV=36,Provider Information\n" + - "DMG=37,Dependent Demographic Information\n" + - "INS=38,Dependent Relationship\n" + - "HI=39,Dependent Health Care Diagnosis Code\n" + - "DTP=40,Dependent Date\n" + - "EQ=41,Dependent Eligibility or Benefit Inquiry\n" + - "III=42,Dependent Eligibility or Benefit Additional Inquiry Information\n" + - "REF=43,Dependent Additional Information\n" + - "DTP=44,Dependent Eligibility/Benefit Date\n" + - "SAMPLE DATA"; +let Rule5010270 = + "FILE DATA\n" + + "Version=005010X279A1\n" + + "Description=270 Eligibility, Coverage or Benefit Inquiry\n" + + "ELEMENT DEFINITIONS\n" + + "19=AN,2,30,City Name\n" + + "26=ID,2,3,Country Code\n" + + "28=NO,1,9,Group Control Number\n" + + "66=ID,1,2,Identification Code Qualifier\n" + + "67=AN,2,80,Identification Code\n" + + "93=AN,1,60,Name\n" + + "96=NO,1,10,Number of Included Segments\n" + + "97=NO,1,6,Number of Transaction Sets Included\n" + + "98=ID,2,3,Entity Identifier Code\n" + + "101=ID,2,2,Authorization Information Qualifier\n" + + "102=AN,10,10,Authorization Information\n" + + "103=ID,2,2,Security Information Qualifier\n" + + "104=AN,10,10,Security Information\n" + + "105=ID,2,2,Interchange ID Qualifier\n" + + "106=AN,15,15,Interchange Sender ID\n" + + "107=AN,15,15,Interchange Receiver ID\n" + + "108=DT,6,6,Interchange Date\n" + + "109=TM,4,4,Interchange Time\n" + + "110=ID,1,1\n" + + "111=ID,5,5,Interchange Control Version Number\n" + + "112=NO,9,9,Interchange Control Number\n" + + "113=ID,1,1,Acknowledgment Requested\n" + + "114=ID,1,1,Interchange Usage Indicator\n" + + "115=ID,1,1,Component Element Separator\n" + + "116=ID,3,15,Postal Code\n" + + "124=AN,2,15,Application Receiver Code\n" + + "127=AN,1,50,Reference Identification\n" + + "128=ID,2,3,Reference Identification Qualifier\n" + + "142=AN,2,15,Application Sender Code\n" + + "143=ID,3,3,Transaction Set Identifier Code\n" + + "156=ID,2,2,State or Province Code\n" + + "165=ID,1,1,Repetition Separator\n" + + "166=AN,1,55,Address Information\n" + + "234=AN,1,48,Product/Service ID\n" + + "235=ID,2,2,Product/Service ID Qualifier\n" + + "309=ID,1,2,Location Qualifier\n" + + "310=AN,1,30,Location Identifier\n" + + "329=AN,4,9,Transaction Set Control Number\n" + + "337=TM,4,8,Time\n" + + "352=AN,1,80,Description\n" + + "353=ID,2,2,Transaction Set Purpose Code\n" + + "364=AN,1,80,Communication Number\n" + + "365=ID,2,2,Communication Number Qualifier\n" + + "366=ID,2,2,Contact Function Code\n" + + "373=DT,8,8,Date\n" + + "374=ID,3,3,Date/Time Qualifier\n" + + "380=R,1,15,Quantity\n" + + "455=ID,1,2,Responsible Agency Code\n" + + "478=ID,1,1,Credit/Debit Flag Code\n" + + "479=ID,2,2,Functional Identifier Code\n" + + "480=AN,1,12,Version / Release / Industry Identifier Code\n" + + "481=ID,1,2,Trace Type Code\n" + + "509=AN,10,10,Originating Company Identifier\n" + + "522=ID,1,3,Amount Qualifier Code\n" + + "584=ID,2,2,Employment Status Code\n" + + "615=ID,1,2,Time Period Qualifier\n" + + "628=AN,1,12,Hierarchical ID Number\n" + + "640=ID,2,2,Transaction Type Code\n" + + "659=ID,1,2,Basis of Verification Code\n" + + "673=ID,2,2,Quantity Qualifier\n" + + "734=AN,1,12,Hierarchical Parent ID Number\n" + + "735=ID,1,12,Hierarchical Level Code\n" + + "736=ID,1,1,Hierarchical Child Code\n" + + "782=R,1,18,Monetary Amount\n" + + "799=AN,1,30,Version Identifier\n" + + "875=ID,3,3,Maintenance Type Code\n" + + "933=AN,1,264,Free-form Message Text\n" + + "934=ID,2,2,Printer Carriage Control Code\n" + + "954=R,1,10,Percent\n" + + "1005=ID,4,4,Hierarchical Structure Code\n" + + "1035=AN,1,60,Name Last or Organization Name\n" + + "1036=AN,1,25,Name First\n" + + "1037=AN,1,25,Name Middle\n" + + "1038=AN,1,10,Name Prefix\n" + + "1039=AN,1,10,Name Suffix\n" + + "1065=ID,1,1,Entity Type Qualifier\n" + + "1066=ID,1,2,Citizenship Status Code\n" + + "1067=ID,1,1,Marital Status Code\n" + + "1068=ID,1,1,Gender Code\n" + + "1069=ID,2,2,Individual Relationship Code\n" + + "1073=ID,1,1,Yes/No Condition or Response Code\n" + + "1109=ID,1,1\n" + + "1136=ID,2,2,Code Category\n" + + "1165=ID,1,1,Confidentiality Code\n" + + "1203=ID,2,3,Maintenance Reason Code\n" + + "1204=AN,1,50,Plan Coverage Description\n" + + "1207=ID,3,3,Coverage Level Code\n" + + "1216=ID,1,1,Benefit Status Code\n" + + "1218=ID,1,1\n" + + "1219=AN,1,2,COBRA\n" + + "1220=ID,1,1,Student Status Code\n" + + "1221=AN,1,3,Provider Code\n" + + "1250=ID,2,3,DateTime Period Format Qualifier\n" + + "1251=AN,1,35,Date Time Period\n" + + "1270=ID,2,3,Code List Qual Code\n" + + "1271=AN,1,30,Industry Code\n" + + "1328=NO,1,2,Diagnosis Code Pointer\n" + + "1336=ID,1,3,Insurance Type Code\n" + + "1339=AN,2,2,Procedure Modifier\n" + + "1365=ID,1,2,Service Type Code\n" + + "1470=NO,1,9,Number\n" + + "1705=AN,1,35,Implementation Convention Reference\n" + + "1715=ID,1,3,Country Subdivision Code\n" + + "11111112=NO,1,9,Interchange Control Number\n" + + "11111116=NO,1,5,Number of Included Functional Groups\n" + + "COMPOSITE ELEMENT DEFINITIONS\n" + + "C003=[235,O][234,O][1339,O][1339,O][1339,O][1339,O][352,O],@@....#\n" + + "C004=[1328,O][1328,O][1328,O][1328,O],@...\n" + + "C022=[1270,O][1271,O][1250,O][1251,O][782,O][380,O][799,O][1271,O][1073,O],@@#######\n" + + "SEGMENT DEFINITIONS\n" + + "AMT=[522][782][478],@@#\n" + + "BHT=[1005,M][353,M][127][373,M][337,M][640]\n" + + "DMG=[1250][1251][1068][1067][1109][1066][26][659][380]+P0102,...######\n" + + "DTP=[374,M][1250,M][1251,M]\n" + + "EQ=[1365][C003][1207][1336][C004]+R0102,..*1.#.*1,..*1##.*1\n" + + "GE=[97,M][28,M]\n" + + "GS=[479,M][142,M][124,M][373,M][337,M][28,M][455,M][480,M]\n" + + "HI=[C022][C022][C022][C022][C022][C022][C022][C022][C022][C022][C022][C022],@*1.*1.*1.*1.*1.*1.*1.*1#*1#*1#*1#*1\n" + + "HL=[628][734][735][736],@#@@,@@@@\n" + + "IEA=[11111116,M][11111112,M]\n" + + "III=[1270,M][1271,M]\n" + + "INS=[1073][1069][875][1203][1216][1218][1219][584][1220][1073][1250][1251][1165][19][156][26][1470],@@##############@,@@##############.\n" + + "ISA=[101,M][102,M][103,M][104,M][105,M][106,M][105,M][107,M][108,M][109,M][165,M][111,M][112,M][113,M][114,M][115,M]\n" + + "MSG=[933][934][1470],@##\n" + + "N3=[166,M][166]\n" + + "N4=[19][156][116][26][309][310][1715],@...##.,....##.,@...##.\n" + + "NM1=[98,M][1065,M][1035][1036][1037][1038][1039][66][67]+P0809,@@...#.@@,@@...#...,@@...#.##,@@@..#.@@\n" + + "PER=[366][93][365][364][365][364][365][364]+P0304P0506P0708,@.......\n" + + "PRV=[1221][128][127],@..\n" + + "REF=[128,M][127,M][352],@@#\n" + + "SE=[96,M][329,M]\n" + + "ST=[143,M][329,M][1705,M]\n" + + "TRN=[481,M][127,M][509,M][127]\n" + + "SEGMENT SELF RULES\n" + + "NM1~2~[EQ]1~4~0\n" + + "NM1~2~[EQ]2~2~4,5\n" + + "COMPOSITE ELEMENT SELF RULES\n" + + "CODELISTS\n" + + "FORMATS\n" + + "Date CCYYMMDD=^(((\\d{4}((0[13578]|1[02])(0[1-9]|[12]\\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\\d|30)|02(0[1-9]|1\\d|2[0-8])))|((\\d{2}[02468][048]|\\d{2}[13579][26]))0229)){0,8}$\n" + + "EDI FILE STRUCTURE\n" + + "{INTERCHANGE HEADER:1[ISA,M]{FUNCTIONAL GROUP:1[GS,M]{ST HEADER:>1[ST,M][BHT,M]{2000A:>1[HL*1,M]{2100A:1[NM1*4,M]}{2000B:>1[HL*2,M]{2100B:1[NM1*4,M][REF,O,9][N3][N4*1][PRV*1]}{2000C:>1[HL*2,M][TRN,O,2]{2100C:1[NM1*2,M][REF*1,O,9][N3][N4*1][PRV*1][DMG*1][INS*1][HI*1][DTP,O,2]{2110C:99[EQ*1][AMT*1][AMT*1][III][REF*1][DTP]}{2000D:>1[HL*2,X][TRN,O,2]{2100D:1[NM1*3,M][REF*1,O,9][N3][N4*3][PRV*1][DMG*1][INS*2][HI*1][DTP,O,2]{2110D:99[EQ*2,M][III][REF*1][DTP]}}}}}}}{END ST HEADER LOOP:1[SE,M]}}{END GS LOOP:1[GE,M]}}{END ISA LOOP:1[IEA,M]}}\n" + + "ELEMENT CODES\n" + + "101=1:1,00,03\n" + + "103=1:3,00,01\n" + + "105=1:5,01,14,20,27,28,29,30,33,ZZ*1:7,01,14,20,27,28,29,30,33,ZZ\n" + + "111=1:12,00501\n" + + "113=1:14,0,1\n" + + "114=1:15,P,T\n" + + "479=2:1,HS\n" + + "455=2:7,X\n" + + "480=2:8,005010X279A1\n" + + "143=3:1,270\n" + + "1705=3:3,005010X279A1\n" + + "1005=4:1,0022\n" + + "353=4:2,01,13\n" + + "640=4:6,RT\n" + + "735=5:3,20*7:3,21*13:3,22*30:3,23\n" + + "736=5:4,1*7:4,1*13:4,0,1*30:4,0\n" + + "98=6:1,2B,36,GP,P5,PR*8:1,1P,2B,36,80,FA,GP,P5,PR*15:1,IL*32:1,03\n" + + "1065=6:2,1,2*8:2,1,2*15:2,1,2*32:2,1\n" + + "66=6:8,24,46,FI,NI,PI,XV,XX*8:8,24,34,FI,PI,PP,SV,XV,XX*15:8,II,MI\n" + + "128=9:1,0B,1C,1D,1J,4A,CT,EL,EO,HPI,JD,N5,N7,Q4,SY,TJ*12:2,PXC*16:1,18,1L,1W,3H,6P,CT,EA,EJ,F6,GH,HJ,IG,N6,NQ,SY,Y4*19:2,9K,D3,EI,HPI,PXC,SY,TJ*28:1,9F,G1*33:1,18,1L,1W,6P,CT,EA,EJ,F6,GH,HJ,IF,IG,MRC,N6,SY,Y4*36:2,9K,D3,EI,HPI,PXC,SY,TJ*43:1,9F,G1\n" + + "1221=12:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SB,SK,SU*19:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU*36:1,AD,AT,BI,CO,CV,H,HH,LA,OT,P1,P2,PC,PE,R,RF,SK,SU\n" + + "481=14:1,1*31:1,1\n" + + "1250=20:1,D8*23:2,D8,RD8*29:2,D8,RD8*37:1,D8*40:2,D8,RD8*44:2,D8,RD8\n" + + "1068=20:3,F,M*37:3,F,M\n" + + "1073=21:1,Y*38:1,N\n" + + "1069=21:2,18*38:2,01,19,34\n" + + "1270=22:1:1,ABK,BK*22:2:1,ABF,BF*22:3:1,ABF,BF*22:4:1,ABF,BF*22:5:1,ABF,BF*22:6:1,ABF,BF*22:7:1,ABF,BF*22:8:1,ABF,BF*27:1,ZZ*39:1:1,ABK,BK*39:2:1,ABF,BF*39:3:1,ABF,BF*39:4:1,ABF,BF*39:5:1,ABF,BF*39:6:1,ABF,BF*39:7:1,ABF,BF*39:8:1,ABF,BF*42:1,BF,BK,ZZ\n" + + "374=23:1,102,291*29:1,291*40:1,102,291*44:1,291\n" + + "1365=24:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,B1,B2,B3,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,C1,CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM,CN,CO,CP,CQ,DG,DM,DS,GF,GN,GY,IC,MH,NI,ON,PT,PU,RN,RT,TC,TN,UC*41:1,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,30,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,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AQ,AR,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK,BL,BM,BN,BP,BQ,BR,BS\n" + + "235=24:2:1,AD,CJ,HC,ID,IV,N4,ZZ*41:2:1,AD,CJ,HC,ID,IV,N4,ZZ\n" + + "1207=24:3,FAM*41:3,CHD,DEP,ECH,EMP,ESP,FAM,IND,SPC,SPO\n" + + "522=25:1,R*26:1,PB\n" + + "1336=41:4,AP,C1,CO,HM,IP,OT,PR,PS,SP,WC\n" + + "ELEMENT FORMATS\n" + + "1251=20:2,0,,Date CCYYMMDD\n" + + "SUMMARY\n" + + "ELEMENT EQUALITY\n" + + "1:13=47:2\n" + + "3:2=45:2\n" + + "RULES\n" + + "24=13:4'EQ'0!USAGE!2!1\n" + + "30=13:4'EQ'1!USAGE!2!1\n" + + "ELEMENT COUNTERS\n" + + "ELEMENT CODE DESCRIPTION\n" + + "LOOP DESCRIPTIONS\n" + + "INTERCHANGE HEADER=START OF INTERCHANGE HEADER\n" + + "FUNCTIONAL GROUP=START OF FUNCTIONAL GROUP\n" + + "ST HEADER=START OF ST HEADER\n" + + "2000A=INFORMATION SOURCE LEVEL\n" + + "2100A=INFORMATION SOURCE NAME\n" + + "2000B=INFORMATION RECEIVER LEVEL\n" + + "2100B=INFORMATION RECEIVER NAME\n" + + "2000C=SUBSCRIBER LEVEL\n" + + "2100C=SUBSCRIBER NAME\n" + + "2110C=SUBSCRIBER ELIGIBILITY OR BENEFIT INQUIRY\n" + + "2000D=DEPENDENT LEVEL\n" + + "2100D=DEPENDENT NAME\n" + + "2110D=DEPENDENT ELIGIBILITY OR BENEFIT INQUIRY\n" + + "END ST HEADER LOOP=END ST HEADER LOOP\n" + + "END GS LOOP=END OF FUNCTIONAL HEADER\n" + + "END ISA LOOP=END OF INTERCHANGE HEADER\n" + + "SEGMENT DESCRIPTIONS\n" + + "ISA=1,Interchange Header\n" + + "GS=2,Functional Group\n" + + "ST=3,Transaction Set Header\n" + + "BHT=4,Beginning of Hierarchical Transaction\n" + + "HL=5,Information Source Level\n" + + "NM1=6,Information Source Name\n" + + "HL=7,Information Receiver Level\n" + + "NM1=8,Information Receiver Name\n" + + "REF=9,Information Receiver Additional Identification\n" + + "N3=10,Information Receiver Address\n" + + "N4=11,Information Receiver City\n" + + "PRV=12,Information Receiver Provider Information\n" + + "HL=13,Subscriber Level\n" + + "TRN=14,Subscriber Trace Number\n" + + "NM1=15,Subscriber Name\n" + + "REF=16,Subscriber Additional Identification\n" + + "N3=17,Subscriber Address\n" + + "N4=18,Subscriber City\n" + + "PRV=19,Provider Information\n" + + "DMG=20,Subscriber Demographic Information\n" + + "INS=21,Multiple Birth Sequence Number\n" + + "HI=22,Subscriber Health Care Diagnosis Code\n" + + "DTP=23,Subscriber Date\n" + + "EQ=24,Subscriber Eligibility or Benefit Inquiry\n" + + "AMT=25,Subscriber Spend Down Amount\n" + + "AMT=26,Subscriber Spend Down Total Billed Amount\n" + + "III=27,Subscriber Eligibility or Benefit Additional Inquiry Information\n" + + "REF=28,Subscriber Additional Information\n" + + "DTP=29,Subscriber Eligibility/Benefit Date\n" + + "HL=30,Dependent Level\n" + + "TRN=31,Dependent Trace Number\n" + + "NM1=32,Dependent Name\n" + + "REF=33,Dependent Additional Identification\n" + + "N3=34,Dependent Address\n" + + "N4=35,Dependent City\n" + + "PRV=36,Provider Information\n" + + "DMG=37,Dependent Demographic Information\n" + + "INS=38,Dependent Relationship\n" + + "HI=39,Dependent Health Care Diagnosis Code\n" + + "DTP=40,Dependent Date\n" + + "EQ=41,Dependent Eligibility or Benefit Inquiry\n" + + "III=42,Dependent Eligibility or Benefit Additional Inquiry Information\n" + + "REF=43,Dependent Additional Information\n" + + "DTP=44,Dependent Eligibility/Benefit Date\n" + + "SAMPLE DATA"; diff --git a/test_harness/generateacknowledgement/enummap.js b/test_harness/generateacknowledgement/enummap.js index 79f224c..c3d1dc3 100644 --- a/test_harness/generateacknowledgement/enummap.js +++ b/test_harness/generateacknowledgement/enummap.js @@ -2,66 +2,66 @@ // RDPCrystalInstallation\Validation Rules directory function EnumMap() { this.SnipLevelTypes = { - 0 : "DoesNotApply", - 1 : "Integrity", - 2 : "Requirement", - 3 : "Balance", - 4 : "Situational", - 5 : "CodeSet", + 0: "DoesNotApply", + 1: "Integrity", + 2: "Requirement", + 3: "Balance", + 4: "Situational", + 5: "CodeSet", }; this.MessageTypes = { - 0 : "None", - 1 : "CompositeElementMissing", - 2 : "CompositeElementDataFormatInvalid", - 3 : "CompositeElementNotUsed", - 4 : "CompositeElementRecommended", - 5 : "CompositeElementNotRecommended", - 6 : "CompositeElementLessThanMinimumLength", - 7 : "CompositeElementGreaterThanMaximumLength", - 8 : "CompositeElementHasWrongValue", - 9 : "CompositeElementValueAlreadyEntered", - 10 : "DuplicateSegment", - 11 : "DuplicateLoop", - 12 : "ElementHasWrongValue", - 13 : "InternalElementHasWrongValue", - 14 : "ElementLessThanMinimumLength", - 15 : "ElementGreaterThanMaximumLength", - 16 : "ElementValueAlreadyEntered", - 17 : "ElementDataFormatInvalid", - 18 : "ElementNotUsed", - 19 : "ElementRecommended", - 20 : "ElementNotRecommended", - 21 : "ElementMissing", - 22 : "EmptyTrailingElements", - 23 : "EmptyTrailingCompositeElement", - 24 : "ExtraElementFound", - 25 : "ExtraCompositeElementFound", - 26 : "ExtraDataAtEndOfFile", - 27 : "LoopMissing", - 28 : "LoopNotUsed", - 29 : "LoopNotRecommended", - 30 : "LoopRecommended", - 31 : "MalformedSegment", - 32 : "InvalidIntegerValue", - 33 : "InvalidDateValue", - 34 : "InvalidTimeValue", - 35 : "InvalidAlphabeticValue", - 36 : "InvalidPositiveNumberValue", - 37 : "InvalidNegativeNumberValue", - 38 : "InvalidDecimalValue", - 39 : "SegmentNotRecommended", - 40 : "SegmentNotUsed", - 41 : "SegmentNotInDictionary", - 42 : "SegmentRecommended", - 43 : "SegmentMissing", - 44 : "SummaryValueMismatch", - 45 : "UnrecognizedLoop", - 46 : "UnrecognizedSegment", - 47 : "IllegalCharactorInFile", - 48 : "MalformedEDIFile", - 49 : "MaximumErrorLimitReached", - 50 : "UnexpectedError", + 0: "None", + 1: "CompositeElementMissing", + 2: "CompositeElementDataFormatInvalid", + 3: "CompositeElementNotUsed", + 4: "CompositeElementRecommended", + 5: "CompositeElementNotRecommended", + 6: "CompositeElementLessThanMinimumLength", + 7: "CompositeElementGreaterThanMaximumLength", + 8: "CompositeElementHasWrongValue", + 9: "CompositeElementValueAlreadyEntered", + 10: "DuplicateSegment", + 11: "DuplicateLoop", + 12: "ElementHasWrongValue", + 13: "InternalElementHasWrongValue", + 14: "ElementLessThanMinimumLength", + 15: "ElementGreaterThanMaximumLength", + 16: "ElementValueAlreadyEntered", + 17: "ElementDataFormatInvalid", + 18: "ElementNotUsed", + 19: "ElementRecommended", + 20: "ElementNotRecommended", + 21: "ElementMissing", + 22: "EmptyTrailingElements", + 23: "EmptyTrailingCompositeElement", + 24: "ExtraElementFound", + 25: "ExtraCompositeElementFound", + 26: "ExtraDataAtEndOfFile", + 27: "LoopMissing", + 28: "LoopNotUsed", + 29: "LoopNotRecommended", + 30: "LoopRecommended", + 31: "MalformedSegment", + 32: "InvalidIntegerValue", + 33: "InvalidDateValue", + 34: "InvalidTimeValue", + 35: "InvalidAlphabeticValue", + 36: "InvalidPositiveNumberValue", + 37: "InvalidNegativeNumberValue", + 38: "InvalidDecimalValue", + 39: "SegmentNotRecommended", + 40: "SegmentNotUsed", + 41: "SegmentNotInDictionary", + 42: "SegmentRecommended", + 43: "SegmentMissing", + 44: "SummaryValueMismatch", + 45: "UnrecognizedLoop", + 46: "UnrecognizedSegment", + 47: "IllegalCharactorInFile", + 48: "MalformedEDIFile", + 49: "MaximumErrorLimitReached", + 50: "UnexpectedError", }; } diff --git a/test_harness/generateacknowledgement/index.js b/test_harness/generateacknowledgement/index.js index 880f7ae..7755700 100644 --- a/test_harness/generateacknowledgement/index.js +++ b/test_harness/generateacknowledgement/index.js @@ -12,32 +12,31 @@ let validator = new edi.EDIValidator(); validator.LoadValidatedData = true; // Load a 5010 270 validation rules -let validationRules = - fs.readFileSync( - "../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") - .toString(); +let validationRules = fs + .readFileSync("../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") + .toString(); validator.EDIRulesFileData = validationRules; // Set the EDI data to validate and load. This can also be read in from a file validator.EDIDataString = - "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + - "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + - "ST*271*1234*005010X279A1~" + - "BHT*0022*13*10001234*20060501*1319~" + - "HL*1**20*1~" + - "NM1*PR*2*ABC COMPANY*****PI*842610001~" + - "HL*2*1*21*1~" + - "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + - "HL*3*2*22*0~" + - "TRN*1*93175-012547*9877281234~" + - "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + - "DMG*D8*19430519~" + - "DTP*291*D8*20060501~" + - "EQ*30~" + - "SE*13*1234~" + - "GE*1*1~" + - "IEA*1*000000905~"; + "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + + "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + + "ST*271*1234*005010X279A1~" + + "BHT*0022*13*10001234*20060501*1319~" + + "HL*1**20*1~" + + "NM1*PR*2*ABC COMPANY*****PI*842610001~" + + "HL*2*1*21*1~" + + "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + + "HL*3*2*22*0~" + + "TRN*1*93175-012547*9877281234~" + + "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + + "DMG*D8*19430519~" + + "DTP*291*D8*20060501~" + + "EQ*30~" + + "SE*13*1234~" + + "GE*1*1~" + + "IEA*1*000000905~"; console.log("Validating 5010 271 EDI Files"); validator.validate(); @@ -49,17 +48,17 @@ for (let i = 0; i < validator.Errors.Count; i++) { let error = validator.Errors.getItem(i); console.log({ - Type : "Error", - Line : error.LineNumber, - Transaction : "", - SnipLevel : map.SnipLevelTypes[error.SnipLevel], - Message : map.MessageTypes[error.Message], - Loop : error.Loop, - Segment : error.Segment, - Element : error.ElementOrdinal, - Composite : error.CompositeElementOrdinal, - Description : error.Description, - Ordinal : error.SegmentOrdinal, + Type: "Error", + Line: error.LineNumber, + Transaction: "", + SnipLevel: map.SnipLevelTypes[error.SnipLevel], + Message: map.MessageTypes[error.Message], + Loop: error.Loop, + Segment: error.Segment, + Element: error.ElementOrdinal, + Composite: error.CompositeElementOrdinal, + Description: error.Description, + Ordinal: error.SegmentOrdinal, }); } diff --git a/test_harness/validatedocument/enummap.js b/test_harness/validatedocument/enummap.js index 79f224c..c3d1dc3 100644 --- a/test_harness/validatedocument/enummap.js +++ b/test_harness/validatedocument/enummap.js @@ -2,66 +2,66 @@ // RDPCrystalInstallation\Validation Rules directory function EnumMap() { this.SnipLevelTypes = { - 0 : "DoesNotApply", - 1 : "Integrity", - 2 : "Requirement", - 3 : "Balance", - 4 : "Situational", - 5 : "CodeSet", + 0: "DoesNotApply", + 1: "Integrity", + 2: "Requirement", + 3: "Balance", + 4: "Situational", + 5: "CodeSet", }; this.MessageTypes = { - 0 : "None", - 1 : "CompositeElementMissing", - 2 : "CompositeElementDataFormatInvalid", - 3 : "CompositeElementNotUsed", - 4 : "CompositeElementRecommended", - 5 : "CompositeElementNotRecommended", - 6 : "CompositeElementLessThanMinimumLength", - 7 : "CompositeElementGreaterThanMaximumLength", - 8 : "CompositeElementHasWrongValue", - 9 : "CompositeElementValueAlreadyEntered", - 10 : "DuplicateSegment", - 11 : "DuplicateLoop", - 12 : "ElementHasWrongValue", - 13 : "InternalElementHasWrongValue", - 14 : "ElementLessThanMinimumLength", - 15 : "ElementGreaterThanMaximumLength", - 16 : "ElementValueAlreadyEntered", - 17 : "ElementDataFormatInvalid", - 18 : "ElementNotUsed", - 19 : "ElementRecommended", - 20 : "ElementNotRecommended", - 21 : "ElementMissing", - 22 : "EmptyTrailingElements", - 23 : "EmptyTrailingCompositeElement", - 24 : "ExtraElementFound", - 25 : "ExtraCompositeElementFound", - 26 : "ExtraDataAtEndOfFile", - 27 : "LoopMissing", - 28 : "LoopNotUsed", - 29 : "LoopNotRecommended", - 30 : "LoopRecommended", - 31 : "MalformedSegment", - 32 : "InvalidIntegerValue", - 33 : "InvalidDateValue", - 34 : "InvalidTimeValue", - 35 : "InvalidAlphabeticValue", - 36 : "InvalidPositiveNumberValue", - 37 : "InvalidNegativeNumberValue", - 38 : "InvalidDecimalValue", - 39 : "SegmentNotRecommended", - 40 : "SegmentNotUsed", - 41 : "SegmentNotInDictionary", - 42 : "SegmentRecommended", - 43 : "SegmentMissing", - 44 : "SummaryValueMismatch", - 45 : "UnrecognizedLoop", - 46 : "UnrecognizedSegment", - 47 : "IllegalCharactorInFile", - 48 : "MalformedEDIFile", - 49 : "MaximumErrorLimitReached", - 50 : "UnexpectedError", + 0: "None", + 1: "CompositeElementMissing", + 2: "CompositeElementDataFormatInvalid", + 3: "CompositeElementNotUsed", + 4: "CompositeElementRecommended", + 5: "CompositeElementNotRecommended", + 6: "CompositeElementLessThanMinimumLength", + 7: "CompositeElementGreaterThanMaximumLength", + 8: "CompositeElementHasWrongValue", + 9: "CompositeElementValueAlreadyEntered", + 10: "DuplicateSegment", + 11: "DuplicateLoop", + 12: "ElementHasWrongValue", + 13: "InternalElementHasWrongValue", + 14: "ElementLessThanMinimumLength", + 15: "ElementGreaterThanMaximumLength", + 16: "ElementValueAlreadyEntered", + 17: "ElementDataFormatInvalid", + 18: "ElementNotUsed", + 19: "ElementRecommended", + 20: "ElementNotRecommended", + 21: "ElementMissing", + 22: "EmptyTrailingElements", + 23: "EmptyTrailingCompositeElement", + 24: "ExtraElementFound", + 25: "ExtraCompositeElementFound", + 26: "ExtraDataAtEndOfFile", + 27: "LoopMissing", + 28: "LoopNotUsed", + 29: "LoopNotRecommended", + 30: "LoopRecommended", + 31: "MalformedSegment", + 32: "InvalidIntegerValue", + 33: "InvalidDateValue", + 34: "InvalidTimeValue", + 35: "InvalidAlphabeticValue", + 36: "InvalidPositiveNumberValue", + 37: "InvalidNegativeNumberValue", + 38: "InvalidDecimalValue", + 39: "SegmentNotRecommended", + 40: "SegmentNotUsed", + 41: "SegmentNotInDictionary", + 42: "SegmentRecommended", + 43: "SegmentMissing", + 44: "SummaryValueMismatch", + 45: "UnrecognizedLoop", + 46: "UnrecognizedSegment", + 47: "IllegalCharactorInFile", + 48: "MalformedEDIFile", + 49: "MaximumErrorLimitReached", + 50: "UnexpectedError", }; } diff --git a/test_harness/validatedocument/index.js b/test_harness/validatedocument/index.js index db8e84b..2ec10b0 100644 --- a/test_harness/validatedocument/index.js +++ b/test_harness/validatedocument/index.js @@ -12,32 +12,31 @@ let validator = new edi.EDIValidator(); validator.LoadValidatedData = true; // Load a 5010 270 validation rules -let validationRules = - fs.readFileSync( - "../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") - .toString(); +let validationRules = fs + .readFileSync("../../validationrules/5010/Rules_5010_270_005010X279A1.Rules") + .toString(); validator.EDIRulesFileData = validationRules; // Set the EDI data to validate and load. This can also be read in from a file validator.EDIDataString = - "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + - "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + - "ST*271*1234*005010X279A1~" + - "BHT*0022*13*10001234*20060501*1319~" + - "HL*1**20*1~" + - "NM1*PR*2*ABC COMPANY*****PI*842610001~" + - "HL*2*1*21*1~" + - "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + - "HL*3*2*22*0~" + - "TRN*1*93175-012547*9877281234~" + - "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + - "DMG*D8*19430519~" + - "DTP*291*D8*20060501~" + - "EQ*30~" + - "SE*13*1234~" + - "GE*1*1~" + - "IEA*1*000000905~"; + "ISA*00*..........*01*SECRET....*ZZ*SUBMITTERS.ID..*ZZ*RECEIVERS.ID...*030101*1253*^*00501*000000905*1*T*:~" + + "GS*Hk*SENDER CODE*RECEIVERCODE*19991231*0802*1*X*005010X279A1~" + + "ST*271*1234*005010X279A1~" + + "BHT*0022*13*10001234*20060501*1319~" + + "HL*1**20*1~" + + "NM1*PR*2*ABC COMPANY*****PI*842610001~" + + "HL*2*1*21*1~" + + "NM1*1P*2*BONE AND JOINT CLINIC*****SV*2000035~" + + "HL*3*2*22*0~" + + "TRN*1*93175-012547*9877281234~" + + "NM1*IL*1*SMITH*ROBERT****MI*11122333301~" + + "DMG*D8*19430519~" + + "DTP*291*D8*20060501~" + + "EQ*30~" + + "SE*13*1234~" + + "GE*1*1~" + + "IEA*1*000000905~"; console.log("Validating 5010 271 EDI Files"); validator.validate(); @@ -48,16 +47,16 @@ for (let i = 0; i < validator.Errors.Count; i++) { let error = validator.Errors.getItem(i); console.log({ - Type : "Error", - Line : error.LineNumber, - Transaction : "", - SnipLevel : map.SnipLevelTypes[error.SnipLevel], // SnipTestLevel Enum - Message : map.MessageTypes[error.Message], // EDIValidationMessage Enum - Loop : error.Loop, - Segment : error.Segment, - Element : error.ElementOrdinal, - Composite : error.CompositeElementOrdinal, - Description : error.Description, - Ordinal : error.SegmentOrdinal, + Type: "Error", + Line: error.LineNumber, + Transaction: "", + SnipLevel: map.SnipLevelTypes[error.SnipLevel], // SnipTestLevel Enum + Message: map.MessageTypes[error.Message], // EDIValidationMessage Enum + Loop: error.Loop, + Segment: error.Segment, + Element: error.ElementOrdinal, + Composite: error.CompositeElementOrdinal, + Description: error.Description, + Ordinal: error.SegmentOrdinal, }); } diff --git a/test_harness/x12_test_harness/group.js b/test_harness/x12_test_harness/group.js index b7e504f..3833533 100644 --- a/test_harness/x12_test_harness/group.js +++ b/test_harness/x12_test_harness/group.js @@ -6,90 +6,90 @@ const { groupedByISA, } = require("./testFiles/835/profee-done"); -describe("Group", function() { +describe("Group", function () { const clp = { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "1", - "3" : "34.25", - "4" : "34.25", - "5" : "", - "6" : "MC", - "7" : "1000210000000030", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "1", + "3": "34.25", + "4": "34.25", + "5": "", + "6": "MC", + "7": "1000210000000030", + "8": "11", + name: "CLP", }; const svcArray = [ { - "1" : "HC", - "2" : "6", - "3" : "6", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2020", - "1-2" : "RB", + "1": "HC", + "2": "6", + "3": "6", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2020", + "1-2": "RB", }, - {"1" : "472", "2" : "20100101", name : "DTM"}, - {"1" : "B6", "2" : "6", name : "AMT"}, + { "1": "472", "2": "20100101", name: "DTM" }, + { "1": "B6", "2": "6", name: "AMT" }, { - "1" : "HC", - "2" : "2.75", - "3" : "2.75", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2700", - "1-2" : "RB", + "1": "HC", + "2": "2.75", + "3": "2.75", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2700", + "1-2": "RB", }, - {"1" : "472", "2" : "20100101", name : "DTM"}, - {"1" : "B6", "2" : "2.75", name : "AMT"}, + { "1": "472", "2": "20100101", name: "DTM" }, + { "1": "B6", "2": "2.75", name: "AMT" }, ]; const grouped = { - name : "2100", - data : [ + name: "2100", + data: [ { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "1", - "3" : "34.25", - "4" : "34.25", - "5" : "", - "6" : "MC", - "7" : "1000210000000030", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "1", + "3": "34.25", + "4": "34.25", + "5": "", + "6": "MC", + "7": "1000210000000030", + "8": "11", + name: "CLP", }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "6", - "3" : "6", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2020", - "1-2" : "RB", + "1": "HC", + "2": "6", + "3": "6", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2020", + "1-2": "RB", }, - {"1" : "472", "2" : "20100101", name : "DTM"}, - {"1" : "B6", "2" : "6", name : "AMT"}, + { "1": "472", "2": "20100101", name: "DTM" }, + { "1": "B6", "2": "6", name: "AMT" }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "2.75", - "3" : "2.75", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2700", - "1-2" : "RB", + "1": "HC", + "2": "2.75", + "3": "2.75", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2700", + "1-2": "RB", }, - {"1" : "472", "2" : "20100101", name : "DTM"}, - {"1" : "B6", "2" : "2.75", name : "AMT"}, + { "1": "472", "2": "20100101", name: "DTM" }, + { "1": "B6", "2": "2.75", name: "AMT" }, ], }, ], @@ -97,80 +97,81 @@ describe("Group", function() { // ! This was written assuming multi-root groups, which is not yet supported. const schema = { - version : - "005010X221A1", // What version of the transaction set this applies to - start : "ST", // What segment starts the group - name : "Transaction", // What is the name of the group - end : "SE", // Closes all nested groups when this is detected - groups : [ + version: "005010X221A1", // What version of the transaction set this applies to + start: "ST", // What segment starts the group + name: "Transaction", // What is the name of the group + end: "SE", // Closes all nested groups when this is detected + groups: [ // An array of groups to create { - start : "N1", // What segment starts the group - end : null, // What segment ends the group - name : "1000", // What is the name of the group - terminators : [ "N1", "LX" ], - groups : [ + start: "N1", // What segment starts the group + end: null, // What segment ends the group + name: "1000", // What is the name of the group + terminators: ["N1", "LX"], + groups: [ // Nested groups { - start : "N1", - end : null, - name : "1000B", + start: "N1", + end: null, + name: "1000B", }, ], }, // -- At this point group 1000A would be pushed down the data stream - // before starting loop 2000 + // before starting loop 2000 { - start : "CLP", - end : null, - name : "2100", - terminators : [ "CLP" ], - groups : [ + start: "CLP", + end: null, + name: "2100", + terminators: ["CLP"], + groups: [ { - start : "SVC", - end : null, - name : "2110", + start: "SVC", + end: null, + name: "2110", }, ], }, ], }; - describe("#constructor()", function() { - it("Should return an instance of group", function() { + describe("#constructor()", function () { + it("Should return an instance of group", function () { const myGroup = new Group(schema.groups[1], clp, () => {}); assert(myGroup instanceof Group); }); }); - describe("#terminate()", function() { - it("Should execute cb with grouped data", function() { + describe("#terminate()", function () { + it("Should execute cb with grouped data", function () { const callDone = (group) => { assert(group instanceof Group); assert.deepStrictEqual(group.data, { - name : "2100", - data : [ {...clp} ], + name: "2100", + data: [{ ...clp }], }); }; const myGroup = new Group(schema.groups[1], clp, callDone); myGroup.terminate(); }); }); - describe("#add()", function() { - it("Should group nested data", function() { - const callDone = - (group) => { assert.deepStrictEqual(group.data, grouped); }; + describe("#add()", function () { + it("Should group nested data", function () { + const callDone = (group) => { + assert.deepStrictEqual(group.data, grouped); + }; const myGroup = new Group(schema.groups[1], clp, callDone); - svcArray.forEach( - (svc) => { assert.strictEqual(myGroup.add(svc), true); }); + svcArray.forEach((svc) => { + assert.strictEqual(myGroup.add(svc), true); + }); myGroup.terminate(); }); - it("Should be able to group multiple nested groups", function() { - const callDone = - (group) => { assert.deepStrictEqual(group.data, groupedByISA); }; + it("Should be able to group multiple nested groups", function () { + const callDone = (group) => { + assert.deepStrictEqual(group.data, groupedByISA); + }; const myGroup = new Group(groupedByISAschema, finished[0], callDone); finished.forEach((item, index) => { // Skip first index / ISA - if (index === 0) - return; + if (index === 0) return; myGroup.add(item); }); diff --git a/test_harness/x12_test_harness/schema.js b/test_harness/x12_test_harness/schema.js index 3f38ae0..96ebcda 100644 --- a/test_harness/x12_test_harness/schema.js +++ b/test_harness/x12_test_harness/schema.js @@ -1,40 +1,44 @@ -const {Schema} = require("../index"); +const { Schema } = require("../index"); const assert = require("assert"); const schema = { - start : "CLP", // What segment starts the group - terminators : [ "SE" ], // What segment ends the group - name : "2100", // What is the name of the group - groups : [ + start: "CLP", // What segment starts the group + terminators: ["SE"], // What segment ends the group + name: "2100", // What is the name of the group + groups: [ // Nested groups { - start : "SVC", - name : "2110", + start: "SVC", + name: "2110", }, ], }; -describe("Schema", function() { - describe("#constructor()", function() { +describe("Schema", function () { + describe("#constructor()", function () { const testSchema = new Schema("005010X221A1", schema, true); - it("Should return an instance of Schema", - function() { assert(testSchema instanceof Schema); }); - it("Should be able to get version", - function() { assert.strictEqual(testSchema.version, "005010X221A1"); }); - it("Should be able to get schema", - function() { assert.deepStrictEqual(testSchema.schema, schema); }); - it("Should be able to get default", - function() { assert.strictEqual(testSchema.default, true); }); + it("Should return an instance of Schema", function () { + assert(testSchema instanceof Schema); + }); + it("Should be able to get version", function () { + assert.strictEqual(testSchema.version, "005010X221A1"); + }); + it("Should be able to get schema", function () { + assert.deepStrictEqual(testSchema.schema, schema); + }); + it("Should be able to get default", function () { + assert.strictEqual(testSchema.default, true); + }); }); - describe("#verifySchema()", function() { - it("Should return the schema if valid", function() { + describe("#verifySchema()", function () { + it("Should return the schema if valid", function () { assert.deepStrictEqual(Schema.verifySchema(schema), schema); }); - it("Should require a start of the group", function() { + it("Should require a start of the group", function () { assert.throws(() => Schema.verifySchema("garbage", Error)); }); - it("Should verify all nested groups have a start", function() { - const testSchema = {...schema}; + it("Should verify all nested groups have a start", function () { + const testSchema = { ...schema }; delete testSchema.groups[0].start; assert.throws(() => Schema.verifySchema(testSchema, Error)); }); diff --git a/test_harness/x12_test_harness/segment.js b/test_harness/x12_test_harness/segment.js index d7a8e5d..274e5fd 100644 --- a/test_harness/x12_test_harness/segment.js +++ b/test_harness/x12_test_harness/segment.js @@ -1,56 +1,56 @@ const Segment = require("../lib/Segment"); const assert = require("assert"); -describe("Segment", function() { +describe("Segment", function () { const delimiters = { - segment : "~", - element : "*", - component : ":", - repetition : "^", + segment: "~", + element: "*", + component: ":", + repetition: "^", }; - describe("#cleanString()", function() { - it("Should remove white space & remove new lines", function() { + describe("#cleanString()", function () { + it("Should remove white space & remove new lines", function () { // CRLF is already replace in X12 class assert.deepEqual(Segment.cleanString(" test \n "), "test"); }); }); - describe("#processElement()", function() { - it("Should return an array of strings, split by the component delimiter", - function() { - // TODO: Remove initial segment when type checking is added - const mySegment = new Segment("AMT*AU*34.25", delimiters); - assert.deepEqual(mySegment.processElement("AU"), [ "AU" ]); - }); - it("If ISA component is left in tact, since it is an actual element", - function() { - // TODO: Remove initial segment when type checking is added - const isa = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; - const mySegment = new Segment(isa, delimiters); - assert.deepEqual(mySegment.processElement(":"), [ ":" ]); - }); + describe("#processElement()", function () { + it("Should return an array of strings, split by the component delimiter", function () { + // TODO: Remove initial segment when type checking is added + const mySegment = new Segment("AMT*AU*34.25", delimiters); + assert.deepEqual(mySegment.processElement("AU"), ["AU"]); + }); + it("If ISA component is left in tact, since it is an actual element", function () { + // TODO: Remove initial segment when type checking is added + const isa = + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; + const mySegment = new Segment(isa, delimiters); + assert.deepEqual(mySegment.processElement(":"), [":"]); + }); }); // Class immediatly calls parse, so constructor test was moved below the other // method tests To be changed in future update when type testing is added to // segment class - describe("#constructor()", function() { + describe("#constructor()", function () { const mySegment = new Segment("AMT*AU*34.25", delimiters); - it("Should return a Segment", - function() { assert(mySegment instanceof Segment); }); - it("Should parse passed raw element string", function() { - assert.deepEqual(mySegment.parsed, [ [ "AU" ], [ "34.25" ] ]); + it("Should return a Segment", function () { + assert(mySegment instanceof Segment); + }); + it("Should parse passed raw element string", function () { + assert.deepEqual(mySegment.parsed, [["AU"], ["34.25"]]); + }); + it("Should parse out the name of the element", function () { + assert.strictEqual(mySegment.name, "AMT"); }); - it("Should parse out the name of the element", - function() { assert.strictEqual(mySegment.name, "AMT"); }); }); - describe("formatted", function() { + describe("formatted", function () { const mySegment = new Segment("AMT*AU*34.25", delimiters); - it("Should return an object of elements", function() { + it("Should return an object of elements", function () { assert.deepEqual(mySegment.formatted, { - name : "AMT", - "1" : "AU", - "2" : "34.25", + name: "AMT", + "1": "AU", + "2": "34.25", }); }); }); diff --git a/test_harness/x12_test_harness/testFiles/835/profee-done.js b/test_harness/x12_test_harness/testFiles/835/profee-done.js index 610fafd..ef1404e 100644 --- a/test_harness/x12_test_harness/testFiles/835/profee-done.js +++ b/test_harness/x12_test_harness/testFiles/835/profee-done.js @@ -1,1026 +1,1026 @@ exports.finished = [ { - "1" : "00", - "2" : "", - "3" : "00", - "4" : "", - "5" : "ZZ", - "6" : "EMEDNYBAT", - "7" : "ZZ", - "8" : "ETIN", - "9" : "100101", - "10" : "1000", - "11" : "^", - "12" : "00501", - "13" : "006000600", - "14" : "0", - "15" : "T", - "16" : ":", - name : "ISA", - }, - { - "1" : "HP", - "2" : "EMEDNYBAT", - "3" : "ETIN", - "4" : "20100101", - "5" : "1050", - "6" : "6000600", - "7" : "X", - "8" : "005010X221A1", - name : "GS", - }, - { - "1" : "835", - "2" : "1740", - name : "ST", - }, - { - "1" : "I", - "2" : "45.75", - "3" : "C", - "4" : "ACH", - "5" : "CCP", - "6" : "01", - "7" : "111", - "8" : "DA", - "9" : "33", - "10" : "1234567890", - "11" : "", - "12" : "01", - "13" : "111", - "14" : "DA", - "15" : "22", - "16" : "20100101", - name : "BPR", + "1": "00", + "2": "", + "3": "00", + "4": "", + "5": "ZZ", + "6": "EMEDNYBAT", + "7": "ZZ", + "8": "ETIN", + "9": "100101", + "10": "1000", + "11": "^", + "12": "00501", + "13": "006000600", + "14": "0", + "15": "T", + "16": ":", + name: "ISA", + }, + { + "1": "HP", + "2": "EMEDNYBAT", + "3": "ETIN", + "4": "20100101", + "5": "1050", + "6": "6000600", + "7": "X", + "8": "005010X221A1", + name: "GS", + }, + { + "1": "835", + "2": "1740", + name: "ST", + }, + { + "1": "I", + "2": "45.75", + "3": "C", + "4": "ACH", + "5": "CCP", + "6": "01", + "7": "111", + "8": "DA", + "9": "33", + "10": "1234567890", + "11": "", + "12": "01", + "13": "111", + "14": "DA", + "15": "22", + "16": "20100101", + name: "BPR", }, { - "1" : "1", - "2" : "10100000000", - "3" : "1000000000", - name : "TRN", + "1": "1", + "2": "10100000000", + "3": "1000000000", + name: "TRN", }, { - "1" : "EV", - "2" : "ETIN", - name : "REF", + "1": "EV", + "2": "ETIN", + name: "REF", }, { - "1" : "405", - "2" : "20100101", - name : "DTM", + "1": "405", + "2": "20100101", + name: "DTM", }, { - "1" : "PR", - "2" : "NYSDOH", - name : "N1", + "1": "PR", + "2": "NYSDOH", + name: "N1", }, { - "1" : "OFFICE OF HEALTH INSURANCE PROGRAMS", - "2" : "CORNING TOWER, EMPIRE STATE PLAZA", - name : "N3", + "1": "OFFICE OF HEALTH INSURANCE PROGRAMS", + "2": "CORNING TOWER, EMPIRE STATE PLAZA", + name: "N3", }, { - "1" : "ALBANY", - "2" : "NY", - "3" : "122370080", - name : "N4", + "1": "ALBANY", + "2": "NY", + "3": "122370080", + name: "N4", }, { - "1" : "BL", - "2" : "PROVIDER SERVICES", - "3" : "TE", - "4" : "8003439000", - "5" : "UR", - "6" : "www.emedny.org", - name : "PER", + "1": "BL", + "2": "PROVIDER SERVICES", + "3": "TE", + "4": "8003439000", + "5": "UR", + "6": "www.emedny.org", + name: "PER", }, { - "1" : "PE", - "2" : "MAJOR MEDICAL PROVIDER", - "3" : "XX", - "4" : "9999999995", - name : "N1", + "1": "PE", + "2": "MAJOR MEDICAL PROVIDER", + "3": "XX", + "4": "9999999995", + name: "N1", }, { - "1" : "TJ", - "2" : "000000000", - name : "REF", + "1": "TJ", + "2": "000000000", + name: "REF", }, { - "1" : "1", - name : "LX", + "1": "1", + name: "LX", }, { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "1", - "3" : "34.25", - "4" : "34.25", - "5" : "", - "6" : "MC", - "7" : "1000210000000030", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "1", + "3": "34.25", + "4": "34.25", + "5": "", + "6": "MC", + "7": "1000210000000030", + "8": "11", + name: "CLP", }, { - "1" : "QC", - "2" : "1", - "3" : "SUBMITTED LAST", - "4" : "SUBMITTED FIRST", - "5" : "", - "6" : "", - "7" : "", - "8" : "MI", - "9" : "LL99999L", - name : "NM1", + "1": "QC", + "2": "1", + "3": "SUBMITTED LAST", + "4": "SUBMITTED FIRST", + "5": "", + "6": "", + "7": "", + "8": "MI", + "9": "LL99999L", + name: "NM1", }, { - "1" : "74", - "2" : "1", - "3" : "CORRECTED LAST", - "4" : "CORRECTED FIRST", - name : "NM1", + "1": "74", + "2": "1", + "3": "CORRECTED LAST", + "4": "CORRECTED FIRST", + name: "NM1", }, { - "1" : "EA", - "2" : "PATIENT ACCOUNT NUMBER", - name : "REF", + "1": "EA", + "2": "PATIENT ACCOUNT NUMBER", + name: "REF", }, { - "1" : "232", - "2" : "20100101", - name : "DTM", + "1": "232", + "2": "20100101", + name: "DTM", }, { - "1" : "233", - "2" : "20100101", - name : "DTM", + "1": "233", + "2": "20100101", + name: "DTM", }, { - "1" : "AU", - "2" : "34.25", - name : "AMT", + "1": "AU", + "2": "34.25", + name: "AMT", }, { - "1" : "HC", - "2" : "6", - "3" : "6", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2020", - "1-2" : "RB", + "1": "HC", + "2": "6", + "3": "6", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2020", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "6", - name : "AMT", + "1": "B6", + "2": "6", + name: "AMT", }, { - "1" : "HC", - "2" : "2.75", - "3" : "2.75", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2700", - "1-2" : "RB", + "1": "HC", + "2": "2.75", + "3": "2.75", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2700", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "2.75", - name : "AMT", + "1": "B6", + "2": "2.75", + name: "AMT", }, { - "1" : "HC", - "2" : "5.5", - "3" : "5.5", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2103", - "1-2" : "RB", + "1": "HC", + "2": "5.5", + "3": "5.5", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2103", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "5.5", - name : "AMT", + "1": "B6", + "2": "5.5", + name: "AMT", }, { - "1" : "HC", - "2" : "20", - "3" : "20", - "4" : "", - "5" : "2", - name : "SVC", - "1-1" : "S0580", + "1": "HC", + "2": "20", + "3": "20", + "4": "", + "5": "2", + name: "SVC", + "1-1": "S0580", }, - {"1" : "472", "2" : "20100101", name : "DTM"}, + { "1": "472", "2": "20100101", name: "DTM" }, { - "1" : "B6", - "2" : "20", - name : "AMT", + "1": "B6", + "2": "20", + name: "AMT", }, { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "2", - "3" : "34", - "4" : "0", - "5" : "", - "6" : "MC", - "7" : "1000220000000020", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "2", + "3": "34", + "4": "0", + "5": "", + "6": "MC", + "7": "1000220000000020", + "8": "11", + name: "CLP", }, { - "1" : "QC", - "2" : "1", - "3" : "SUBMITTED LAST", - "4" : "SUBMITTED FIRST", - "5" : "", - "6" : "", - "7" : "", - "8" : "MI", - "9" : "LL88888L", - name : "NM1", + "1": "QC", + "2": "1", + "3": "SUBMITTED LAST", + "4": "SUBMITTED FIRST", + "5": "", + "6": "", + "7": "", + "8": "MI", + "9": "LL88888L", + name: "NM1", }, { - "1" : "74", - "2" : "1", - "3" : "CORRECTED LAST", - "4" : "CORRECTED FIRST", - name : "NM1", + "1": "74", + "2": "1", + "3": "CORRECTED LAST", + "4": "CORRECTED FIRST", + name: "NM1", }, { - "1" : "EA", - "2" : "PATIENT ACCOUNT NUMBER", - name : "REF", + "1": "EA", + "2": "PATIENT ACCOUNT NUMBER", + name: "REF", }, { - "1" : "232", - "2" : "20100101", - name : "DTM", + "1": "232", + "2": "20100101", + name: "DTM", }, { - "1" : "233", - "2" : "20100101", - name : "DTM", + "1": "233", + "2": "20100101", + name: "DTM", }, { - "1" : "HC", - "2" : "12", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "V2020", + "1": "HC", + "2": "12", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "V2020", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "29", - "3" : "12", - name : "CAS", + "1": "CO", + "2": "29", + "3": "12", + name: "CAS", }, { - "1" : "HC", - "2" : "22", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "V2103", + "1": "HC", + "2": "22", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "V2103", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "29", - "3" : "22", - name : "CAS", + "1": "CO", + "2": "29", + "3": "22", + name: "CAS", }, { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "2", - "3" : "34.25", - "4" : "11.5", - "5" : "", - "6" : "MC", - "7" : "1000230000000020", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "2", + "3": "34.25", + "4": "11.5", + "5": "", + "6": "MC", + "7": "1000230000000020", + "8": "11", + name: "CLP", }, { - "1" : "QC", - "2" : "1", - "3" : "SUBMITTED LAST", - "4" : "SUBMITTED FIRST", - "5" : "", - "6" : "", - "7" : "", - "8" : "MI", - "9" : "LL77777L", - name : "NM1", + "1": "QC", + "2": "1", + "3": "SUBMITTED LAST", + "4": "SUBMITTED FIRST", + "5": "", + "6": "", + "7": "", + "8": "MI", + "9": "LL77777L", + name: "NM1", }, { - "1" : "74", - "2" : "1", - "3" : "CORRECTED LAST", - "4" : "CORRECTED FIRST", - name : "NM1", + "1": "74", + "2": "1", + "3": "CORRECTED LAST", + "4": "CORRECTED FIRST", + name: "NM1", }, { - "1" : "EA", - "2" : "PATIENT ACCOUNT NUMBER", - name : "REF", + "1": "EA", + "2": "PATIENT ACCOUNT NUMBER", + name: "REF", }, { - "1" : "232", - "2" : "20100101", - name : "DTM", + "1": "232", + "2": "20100101", + name: "DTM", }, { - "1" : "233", - "2" : "20100101", - name : "DTM", + "1": "233", + "2": "20100101", + name: "DTM", }, { - "1" : "AU", - "2" : "11.5", - name : "AMT", + "1": "AU", + "2": "11.5", + name: "AMT", }, { - "1" : "HC", - "2" : "6", - "3" : "6", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2020", - "1-2" : "RB", + "1": "HC", + "2": "6", + "3": "6", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2020", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "6", - name : "AMT", + "1": "B6", + "2": "6", + name: "AMT", }, { - "1" : "HC", - "2" : "5.5", - "3" : "5.5", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2103", - "1-2" : "RB", + "1": "HC", + "2": "5.5", + "3": "5.5", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2103", + "1-2": "RB", }, { - "1" : "472", - "2" : "20130917", - name : "DTM", + "1": "472", + "2": "20130917", + name: "DTM", }, { - "1" : "B6", - "2" : "5.5", - name : "AMT", + "1": "B6", + "2": "5.5", + name: "AMT", }, { - "1" : "HC", - "2" : "2.75", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "V2700", - "1-2" : "RB", + "1": "HC", + "2": "2.75", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "V2700", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "251", - "3" : "2.75", - name : "CAS", + "1": "CO", + "2": "251", + "3": "2.75", + name: "CAS", }, { - "1" : "HE", - "2" : "N206", - name : "LQ", + "1": "HE", + "2": "N206", + name: "LQ", }, { - "1" : "HC", - "2" : "20", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "S0580", + "1": "HC", + "2": "20", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "S0580", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "251", - "3" : "20", - name : "CAS", + "1": "CO", + "2": "251", + "3": "20", + name: "CAS", }, { - "1" : "HE", - "2" : "N206", - name : "LQ", + "1": "HE", + "2": "N206", + name: "LQ", }, { - "1" : "65", - "2" : "1740", - name : "SE", + "1": "65", + "2": "1740", + name: "SE", }, { - "1" : "1", - "2" : "6000600", - name : "GE", + "1": "1", + "2": "6000600", + name: "GE", }, { - "1" : "1", - "2" : "006000600", - name : "IEA", + "1": "1", + "2": "006000600", + name: "IEA", }, ]; exports.groupedByISA = { - name : "Envelope", - data : [ + name: "Envelope", + data: [ { - "1" : "00", - "2" : "", - "3" : "00", - "4" : "", - "5" : "ZZ", - "6" : "EMEDNYBAT", - "7" : "ZZ", - "8" : "ETIN", - "9" : "100101", - "10" : "1000", - "11" : "^", - "12" : "00501", - "13" : "006000600", - "14" : "0", - "15" : "T", - "16" : ":", - name : "ISA", + "1": "00", + "2": "", + "3": "00", + "4": "", + "5": "ZZ", + "6": "EMEDNYBAT", + "7": "ZZ", + "8": "ETIN", + "9": "100101", + "10": "1000", + "11": "^", + "12": "00501", + "13": "006000600", + "14": "0", + "15": "T", + "16": ":", + name: "ISA", }, { - "1" : "HP", - "2" : "EMEDNYBAT", - "3" : "ETIN", - "4" : "20100101", - "5" : "1050", - "6" : "6000600", - "7" : "X", - "8" : "005010X221A1", - name : "GS", + "1": "HP", + "2": "EMEDNYBAT", + "3": "ETIN", + "4": "20100101", + "5": "1050", + "6": "6000600", + "7": "X", + "8": "005010X221A1", + name: "GS", }, { - "1" : "835", - "2" : "1740", - name : "ST", + "1": "835", + "2": "1740", + name: "ST", }, { - name : "headers", - data : [ + name: "headers", + data: [ { - "1" : "I", - "2" : "45.75", - "3" : "C", - "4" : "ACH", - "5" : "CCP", - "6" : "01", - "7" : "111", - "8" : "DA", - "9" : "33", - "10" : "1234567890", - "11" : "", - "12" : "01", - "13" : "111", - "14" : "DA", - "15" : "22", - "16" : "20100101", - name : "BPR", + "1": "I", + "2": "45.75", + "3": "C", + "4": "ACH", + "5": "CCP", + "6": "01", + "7": "111", + "8": "DA", + "9": "33", + "10": "1234567890", + "11": "", + "12": "01", + "13": "111", + "14": "DA", + "15": "22", + "16": "20100101", + name: "BPR", }, { - "1" : "1", - "2" : "10100000000", - "3" : "1000000000", - name : "TRN", + "1": "1", + "2": "10100000000", + "3": "1000000000", + name: "TRN", }, { - "1" : "EV", - "2" : "ETIN", - name : "REF", + "1": "EV", + "2": "ETIN", + name: "REF", }, { - "1" : "405", - "2" : "20100101", - name : "DTM", + "1": "405", + "2": "20100101", + name: "DTM", }, ], }, { - name : "1000", - data : [ + name: "1000", + data: [ { - "1" : "PR", - "2" : "NYSDOH", - name : "N1", + "1": "PR", + "2": "NYSDOH", + name: "N1", }, { - "1" : "OFFICE OF HEALTH INSURANCE PROGRAMS", - "2" : "CORNING TOWER, EMPIRE STATE PLAZA", - name : "N3", + "1": "OFFICE OF HEALTH INSURANCE PROGRAMS", + "2": "CORNING TOWER, EMPIRE STATE PLAZA", + name: "N3", }, { - "1" : "ALBANY", - "2" : "NY", - "3" : "122370080", - name : "N4", + "1": "ALBANY", + "2": "NY", + "3": "122370080", + name: "N4", }, { - "1" : "BL", - "2" : "PROVIDER SERVICES", - "3" : "TE", - "4" : "8003439000", - "5" : "UR", - "6" : "www.emedny.org", - name : "PER", + "1": "BL", + "2": "PROVIDER SERVICES", + "3": "TE", + "4": "8003439000", + "5": "UR", + "6": "www.emedny.org", + name: "PER", }, ], }, { - name : "1000", - data : [ + name: "1000", + data: [ { - "1" : "PE", - "2" : "MAJOR MEDICAL PROVIDER", - "3" : "XX", - "4" : "9999999995", - name : "N1", + "1": "PE", + "2": "MAJOR MEDICAL PROVIDER", + "3": "XX", + "4": "9999999995", + name: "N1", }, { - "1" : "TJ", - "2" : "000000000", - name : "REF", + "1": "TJ", + "2": "000000000", + name: "REF", }, ], }, { - name : "2000", - data : [ + name: "2000", + data: [ { - "1" : "1", - name : "LX", + "1": "1", + name: "LX", }, { - name : "2100", - data : [ + name: "2100", + data: [ { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "1", - "3" : "34.25", - "4" : "34.25", - "5" : "", - "6" : "MC", - "7" : "1000210000000030", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "1", + "3": "34.25", + "4": "34.25", + "5": "", + "6": "MC", + "7": "1000210000000030", + "8": "11", + name: "CLP", }, { - "1" : "QC", - "2" : "1", - "3" : "SUBMITTED LAST", - "4" : "SUBMITTED FIRST", - "5" : "", - "6" : "", - "7" : "", - "8" : "MI", - "9" : "LL99999L", - name : "NM1", + "1": "QC", + "2": "1", + "3": "SUBMITTED LAST", + "4": "SUBMITTED FIRST", + "5": "", + "6": "", + "7": "", + "8": "MI", + "9": "LL99999L", + name: "NM1", }, { - "1" : "74", - "2" : "1", - "3" : "CORRECTED LAST", - "4" : "CORRECTED FIRST", - name : "NM1", + "1": "74", + "2": "1", + "3": "CORRECTED LAST", + "4": "CORRECTED FIRST", + name: "NM1", }, { - "1" : "EA", - "2" : "PATIENT ACCOUNT NUMBER", - name : "REF", + "1": "EA", + "2": "PATIENT ACCOUNT NUMBER", + name: "REF", }, { - "1" : "232", - "2" : "20100101", - name : "DTM", + "1": "232", + "2": "20100101", + name: "DTM", }, { - "1" : "233", - "2" : "20100101", - name : "DTM", + "1": "233", + "2": "20100101", + name: "DTM", }, { - "1" : "AU", - "2" : "34.25", - name : "AMT", + "1": "AU", + "2": "34.25", + name: "AMT", }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "6", - "3" : "6", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2020", - "1-2" : "RB", + "1": "HC", + "2": "6", + "3": "6", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2020", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "6", - name : "AMT", + "1": "B6", + "2": "6", + name: "AMT", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "2.75", - "3" : "2.75", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2700", - "1-2" : "RB", + "1": "HC", + "2": "2.75", + "3": "2.75", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2700", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "2.75", - name : "AMT", + "1": "B6", + "2": "2.75", + name: "AMT", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "5.5", - "3" : "5.5", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2103", - "1-2" : "RB", + "1": "HC", + "2": "5.5", + "3": "5.5", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2103", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "5.5", - name : "AMT", + "1": "B6", + "2": "5.5", + name: "AMT", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "20", - "3" : "20", - "4" : "", - "5" : "2", - name : "SVC", - "1-1" : "S0580", + "1": "HC", + "2": "20", + "3": "20", + "4": "", + "5": "2", + name: "SVC", + "1-1": "S0580", }, - {"1" : "472", "2" : "20100101", name : "DTM"}, + { "1": "472", "2": "20100101", name: "DTM" }, { - "1" : "B6", - "2" : "20", - name : "AMT", + "1": "B6", + "2": "20", + name: "AMT", }, ], }, ], }, { - name : "2100", - data : [ + name: "2100", + data: [ { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "2", - "3" : "34", - "4" : "0", - "5" : "", - "6" : "MC", - "7" : "1000220000000020", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "2", + "3": "34", + "4": "0", + "5": "", + "6": "MC", + "7": "1000220000000020", + "8": "11", + name: "CLP", }, { - "1" : "QC", - "2" : "1", - "3" : "SUBMITTED LAST", - "4" : "SUBMITTED FIRST", - "5" : "", - "6" : "", - "7" : "", - "8" : "MI", - "9" : "LL88888L", - name : "NM1", + "1": "QC", + "2": "1", + "3": "SUBMITTED LAST", + "4": "SUBMITTED FIRST", + "5": "", + "6": "", + "7": "", + "8": "MI", + "9": "LL88888L", + name: "NM1", }, { - "1" : "74", - "2" : "1", - "3" : "CORRECTED LAST", - "4" : "CORRECTED FIRST", - name : "NM1", + "1": "74", + "2": "1", + "3": "CORRECTED LAST", + "4": "CORRECTED FIRST", + name: "NM1", }, { - "1" : "EA", - "2" : "PATIENT ACCOUNT NUMBER", - name : "REF", + "1": "EA", + "2": "PATIENT ACCOUNT NUMBER", + name: "REF", }, { - "1" : "232", - "2" : "20100101", - name : "DTM", + "1": "232", + "2": "20100101", + name: "DTM", }, { - "1" : "233", - "2" : "20100101", - name : "DTM", + "1": "233", + "2": "20100101", + name: "DTM", }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "12", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "V2020", + "1": "HC", + "2": "12", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "V2020", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "29", - "3" : "12", - name : "CAS", + "1": "CO", + "2": "29", + "3": "12", + name: "CAS", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "22", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "V2103", + "1": "HC", + "2": "22", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "V2103", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "29", - "3" : "22", - name : "CAS", + "1": "CO", + "2": "29", + "3": "22", + name: "CAS", }, ], }, ], }, { - name : "2100", - data : [ + name: "2100", + data: [ { - "1" : "PATIENT ACCOUNT NUMBER", - "2" : "2", - "3" : "34.25", - "4" : "11.5", - "5" : "", - "6" : "MC", - "7" : "1000230000000020", - "8" : "11", - name : "CLP", + "1": "PATIENT ACCOUNT NUMBER", + "2": "2", + "3": "34.25", + "4": "11.5", + "5": "", + "6": "MC", + "7": "1000230000000020", + "8": "11", + name: "CLP", }, { - "1" : "QC", - "2" : "1", - "3" : "SUBMITTED LAST", - "4" : "SUBMITTED FIRST", - "5" : "", - "6" : "", - "7" : "", - "8" : "MI", - "9" : "LL77777L", - name : "NM1", + "1": "QC", + "2": "1", + "3": "SUBMITTED LAST", + "4": "SUBMITTED FIRST", + "5": "", + "6": "", + "7": "", + "8": "MI", + "9": "LL77777L", + name: "NM1", }, { - "1" : "74", - "2" : "1", - "3" : "CORRECTED LAST", - "4" : "CORRECTED FIRST", - name : "NM1", + "1": "74", + "2": "1", + "3": "CORRECTED LAST", + "4": "CORRECTED FIRST", + name: "NM1", }, { - "1" : "EA", - "2" : "PATIENT ACCOUNT NUMBER", - name : "REF", + "1": "EA", + "2": "PATIENT ACCOUNT NUMBER", + name: "REF", }, { - "1" : "232", - "2" : "20100101", - name : "DTM", + "1": "232", + "2": "20100101", + name: "DTM", }, { - "1" : "233", - "2" : "20100101", - name : "DTM", + "1": "233", + "2": "20100101", + name: "DTM", }, { - "1" : "AU", - "2" : "11.5", - name : "AMT", + "1": "AU", + "2": "11.5", + name: "AMT", }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "6", - "3" : "6", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2020", - "1-2" : "RB", + "1": "HC", + "2": "6", + "3": "6", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2020", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "B6", - "2" : "6", - name : "AMT", + "1": "B6", + "2": "6", + name: "AMT", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "5.5", - "3" : "5.5", - "4" : "", - "5" : "1", - name : "SVC", - "1-1" : "V2103", - "1-2" : "RB", + "1": "HC", + "2": "5.5", + "3": "5.5", + "4": "", + "5": "1", + name: "SVC", + "1-1": "V2103", + "1-2": "RB", }, { - "1" : "472", - "2" : "20130917", - name : "DTM", + "1": "472", + "2": "20130917", + name: "DTM", }, { - "1" : "B6", - "2" : "5.5", - name : "AMT", + "1": "B6", + "2": "5.5", + name: "AMT", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "2.75", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "V2700", - "1-2" : "RB", + "1": "HC", + "2": "2.75", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "V2700", + "1-2": "RB", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "251", - "3" : "2.75", - name : "CAS", + "1": "CO", + "2": "251", + "3": "2.75", + name: "CAS", }, { - "1" : "HE", - "2" : "N206", - name : "LQ", + "1": "HE", + "2": "N206", + name: "LQ", }, ], }, { - name : "2110", - data : [ + name: "2110", + data: [ { - "1" : "HC", - "2" : "20", - "3" : "0", - "4" : "", - "5" : "0", - name : "SVC", - "1-1" : "S0580", + "1": "HC", + "2": "20", + "3": "0", + "4": "", + "5": "0", + name: "SVC", + "1-1": "S0580", }, { - "1" : "472", - "2" : "20100101", - name : "DTM", + "1": "472", + "2": "20100101", + name: "DTM", }, { - "1" : "CO", - "2" : "251", - "3" : "20", - name : "CAS", + "1": "CO", + "2": "251", + "3": "20", + name: "CAS", }, { - "1" : "HE", - "2" : "N206", - name : "LQ", + "1": "HE", + "2": "N206", + name: "LQ", }, ], }, @@ -1029,51 +1029,51 @@ exports.groupedByISA = { ], }, { - "1" : "65", - "2" : "1740", - name : "SE", + "1": "65", + "2": "1740", + name: "SE", }, { - "1" : "1", - "2" : "6000600", - name : "GE", + "1": "1", + "2": "6000600", + name: "GE", }, { - "1" : "1", - "2" : "006000600", - name : "IEA", + "1": "1", + "2": "006000600", + name: "IEA", }, ], }; exports.groupedByISAschema = { - start : "ISA", // What segment starts the group - end : "IEA", // What segment ends the group - name : "Envelope", // What is the name of the group - groups : [ + start: "ISA", // What segment starts the group + end: "IEA", // What segment ends the group + name: "Envelope", // What is the name of the group + groups: [ // Nested groups { - start : "BPR", - terminators : [ "N1" ], - name : "headers", + start: "BPR", + terminators: ["N1"], + name: "headers", }, { - start : "N1", - terminators : [ "LX" ], - name : "1000", + start: "N1", + terminators: ["LX"], + name: "1000", }, { - start : "LX", - name : "2000", - terminators : [ "SE" ], - groups : [ + start: "LX", + name: "2000", + terminators: ["SE"], + groups: [ { - start : "CLP", - name : "2100", - groups : [ + start: "CLP", + name: "2100", + groups: [ { - start : "SVC", - name : "2110", + start: "SVC", + name: "2110", }, ], }, diff --git a/test_harness/x12_test_harness/x12grouper.js b/test_harness/x12_test_harness/x12grouper.js index 24a838d..bc78192 100644 --- a/test_harness/x12_test_harness/x12grouper.js +++ b/test_harness/x12_test_harness/x12grouper.js @@ -1,16 +1,16 @@ -const {X12grouper, Schema} = require("../index"); +const { X12grouper, Schema } = require("../index"); const assert = require("assert"); -const {finished} = require("./testFiles/835/profee-done"); +const { finished } = require("./testFiles/835/profee-done"); const schema = { - start : "CLP", // What segment starts the group - terminators : [ "SE" ], // What segment ends the group - name : "2100", // What is the name of the group - groups : [ + start: "CLP", // What segment starts the group + terminators: ["SE"], // What segment ends the group + name: "2100", // What is the name of the group + groups: [ // Nested groups { - start : "SVC", - name : "2110", + start: "SVC", + name: "2110", }, ], }; @@ -19,96 +19,90 @@ const testSchema = new Schema("005010X221A1", schema, true); const testSchema2 = new Schema("005010X221", schema, false); // TODO: Still need to add unit tests for some specific methods -describe("X12grouper", function() { - describe("#constructor()", function() { +describe("X12grouper", function () { + describe("#constructor()", function () { const myGrouper = new X12grouper(testSchema); - it("Should return an X12grouper", - function() { assert(myGrouper instanceof X12grouper); }); - it("Should have a pipe function", - function() { assert.strictEqual(typeof myGrouper.pipe, "function"); }); - it("Should return an event emitter", function() { + it("Should return an X12grouper", function () { + assert(myGrouper instanceof X12grouper); + }); + it("Should have a pipe function", function () { + assert.strictEqual(typeof myGrouper.pipe, "function"); + }); + it("Should return an event emitter", function () { assert(myGrouper instanceof require("events").EventEmitter); }); - it("Should accept a single schema object", function() { + it("Should accept a single schema object", function () { const tmpGrouper = new X12grouper(testSchema); - assert.deepStrictEqual(tmpGrouper._schemas, [ testSchema ]); + assert.deepStrictEqual(tmpGrouper._schemas, [testSchema]); }); - it("Should accept an array of schemas", function() { - const tmpGrouper = new X12grouper([ testSchema, testSchema2 ]); - assert.deepStrictEqual(tmpGrouper._schemas, [ testSchema, testSchema2 ]); + it("Should accept an array of schemas", function () { + const tmpGrouper = new X12grouper([testSchema, testSchema2]); + assert.deepStrictEqual(tmpGrouper._schemas, [testSchema, testSchema2]); }); }); - describe("#processSegment()", function() { - it("ISA should go into an intial hold", function() { + describe("#processSegment()", function () { + it("ISA should go into an intial hold", function () { const tmpGrouper = new X12grouper(testSchema); tmpGrouper.write(finished[0]); // ISA assert.deepStrictEqual(tmpGrouper._initialHold[0], finished[0]); }); - it("Items in initial hold should come down pipe before new segment", - function() { - // ISA -> Hold - // GS -> Process Hold (ISA) -> Process GS - const tmpGrouper = new X12grouper(testSchema); - let counter = 0; - tmpGrouper.on("data", (data) => { - assert.deepStrictEqual(finished[counter], data); - counter++; - }); - tmpGrouper.write(finished[0]); // ISA - tmpGrouper.write(finished[1]); // GS - }); + it("Items in initial hold should come down pipe before new segment", function () { + // ISA -> Hold + // GS -> Process Hold (ISA) -> Process GS + const tmpGrouper = new X12grouper(testSchema); + let counter = 0; + tmpGrouper.on("data", (data) => { + assert.deepStrictEqual(finished[counter], data); + counter++; + }); + tmpGrouper.write(finished[0]); // ISA + tmpGrouper.write(finished[1]); // GS + }); }); - describe("Schema detection", function() { - it("Should set the version to GS08", function() { - const tmpGrouper = new X12grouper([ testSchema, testSchema2 ]); + describe("Schema detection", function () { + it("Should set the version to GS08", function () { + const tmpGrouper = new X12grouper([testSchema, testSchema2]); tmpGrouper.write(finished[1]); assert.strictEqual(tmpGrouper._version, "005010X221A1"); - tmpGrouper.write({...finished[1], "8" : "005010X221"}); + tmpGrouper.write({ ...finished[1], "8": "005010X221" }); + assert.strictEqual(tmpGrouper._version, "005010X221"); + }); + it("The first schema marked as default will be the default schema", function () { + const tmpGrouper = new X12grouper([testSchema2, testSchema]); + assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema); + }); + it("If no schemas are marked as the default the first schema will be used as default", function () { + const tmpGrouper = new X12grouper([ + testSchema2, + new Schema("005010X221A1", schema), + ]); + assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema2); + }); + it("If there is a schema version that matches GS08 it will be used", function () { + const tmpSchema = new Schema("005010X221A1", { ...schema, name: "test" }); + const tmpGrouper = new X12grouper([testSchema2, tmpSchema]); + tmpGrouper.write(finished[1]); // GS + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); + }); + it("If there is no schema version that matches GS08 the default will be used", function () { + const tmpSchema = new Schema("random", { ...schema, name: "test" }); + const tmpGrouper = new X12grouper([testSchema2, tmpSchema]); + tmpGrouper.write(finished[1]); // GS + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); + }); + it("If segment is GS it will update the version and use new schema", function () { + const tmpSchema = new Schema("005010X221A1", { ...schema, name: "test" }); + const tmpGrouper = new X12grouper([testSchema2, tmpSchema]); + tmpGrouper.write(finished[1]); // GS - 005010X221A1 + tmpGrouper.write(finished[14]); // CLP + assert.strictEqual(tmpGrouper._version, "005010X221A1"); + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); + tmpGrouper.write({ ...finished[1], "8": "005010X221" }); // GS + tmpGrouper.write(finished[14]); // CLP assert.strictEqual(tmpGrouper._version, "005010X221"); + assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); }); - it("The first schema marked as default will be the default schema", - function() { - const tmpGrouper = new X12grouper([ testSchema2, testSchema ]); - assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema); - }); - it("If no schemas are marked as the default the first schema will be used as default", - function() { - const tmpGrouper = new X12grouper([ - testSchema2, - new Schema("005010X221A1", schema), - ]); - assert.deepStrictEqual(tmpGrouper._defaultSchema, testSchema2); - }); - it("If there is a schema version that matches GS08 it will be used", - function() { - const tmpSchema = - new Schema("005010X221A1", {...schema, name : "test"}); - const tmpGrouper = new X12grouper([ testSchema2, tmpSchema ]); - tmpGrouper.write(finished[1]); // GS - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); - }); - it("If there is no schema version that matches GS08 the default will be used", - function() { - const tmpSchema = new Schema("random", {...schema, name : "test"}); - const tmpGrouper = new X12grouper([ testSchema2, tmpSchema ]); - tmpGrouper.write(finished[1]); // GS - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); - }); - it("If segment is GS it will update the version and use new schema", - function() { - const tmpSchema = - new Schema("005010X221A1", {...schema, name : "test"}); - const tmpGrouper = new X12grouper([ testSchema2, tmpSchema ]); - tmpGrouper.write(finished[1]); // GS - 005010X221A1 - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._version, "005010X221A1"); - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "test"); - tmpGrouper.write({...finished[1], "8" : "005010X221"}); // GS - tmpGrouper.write(finished[14]); // CLP - assert.strictEqual(tmpGrouper._version, "005010X221"); - assert.strictEqual(tmpGrouper._activeGroup._schema.name, "2100"); - }); }); }); diff --git a/test_harness/x12_test_harness/x12parser.js b/test_harness/x12_test_harness/x12parser.js index c0b5f2a..e7df376 100644 --- a/test_harness/x12_test_harness/x12parser.js +++ b/test_harness/x12_test_harness/x12parser.js @@ -1,93 +1,97 @@ -const {X12parser} = require("../index"); +const { X12parser } = require("../index"); const assert = require("assert"); -const {createReadStream} = require("fs"); +const { createReadStream } = require("fs"); -describe("X12parser", function() { - describe("#constructor()", function() { +describe("X12parser", function () { + describe("#constructor()", function () { const myParser = new X12parser(); - it("Should return an X12parser", - function() { assert(myParser instanceof X12parser); }); - it("Should have a pipe function", - function() { assert.strictEqual(typeof myParser.pipe, "function"); }); - it("Should return an event emitter", function() { + it("Should return an X12parser", function () { + assert(myParser instanceof X12parser); + }); + it("Should have a pipe function", function () { + assert.strictEqual(typeof myParser.pipe, "function"); + }); + it("Should return an event emitter", function () { assert(myParser instanceof require("events").EventEmitter); }); }); - describe("#detectDelimiters()", function() { + describe("#detectDelimiters()", function () { const isa1 = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; const isa2 = - "ISA&00& &00& &ZZ&EMEDNYBAT &ZZ&ETIN &100101&1000&#&00501&006000600&0&T&@$"; - it("Should be abl to auto detect delimiters from ISA", function() { + "ISA&00& &00& &ZZ&EMEDNYBAT &ZZ&ETIN &100101&1000&#&00501&006000600&0&T&@$"; + it("Should be abl to auto detect delimiters from ISA", function () { assert.deepEqual(X12parser.detectDelimiters(isa1), { - segment : "~", - component : ":", - element : "*", - repetition : "^", + segment: "~", + component: ":", + element: "*", + repetition: "^", }); assert.deepEqual(X12parser.detectDelimiters(isa2), { - segment : "$", - component : "@", - element : "&", - repetition : "#", + segment: "$", + component: "@", + element: "&", + repetition: "#", }); }); }); - describe("#removeDelimiters()", function() { + describe("#removeDelimiters()", function () { const myParser = new X12parser(); myParser._delimiters = { - segment : "~", - component : ":", - element : "*", - repetition : "^", + segment: "~", + component: ":", + element: "*", + repetition: "^", }; const isa1 = - "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; + "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; const isa2 = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; const isa3 = - "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; + "~ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:~"; const delimitersRemoved = - "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; - it("Should remove delimiter from start of string", function() { + "ISA*00* *00* *ZZ*EMEDNYBAT *ZZ*ETIN *100101*1000*^*00501*006000600*0*T*:"; + it("Should remove delimiter from start of string", function () { assert.deepEqual(myParser.removeDelimiters(isa1), delimitersRemoved); }); - it("Should remove delimiter from end of string", function() { + it("Should remove delimiter from end of string", function () { assert.deepEqual(myParser.removeDelimiters(isa2), delimitersRemoved); }); - it("Should remove delimiter from start and end of string", function() { + it("Should remove delimiter from start and end of string", function () { assert.deepEqual(myParser.removeDelimiters(isa3), delimitersRemoved); }); }); - describe("835 File Tests", function() { - it("Should parse files with CRLF", function() { + describe("835 File Tests", function () { + it("Should parse files with CRLF", function () { const myParser = new X12parser(); const testFile = createReadStream("./test/testFiles/835/profee.edi"); let counter = 0; // So ugly... This should be done nicer - const {finished} = require("./testFiles/835/profee-done"); + const { finished } = require("./testFiles/835/profee-done"); testFile.pipe(myParser).on("data", (data) => { assert.deepStrictEqual(data, finished[counter]); counter++; }); }); - it("Should parse single line files", function() { + it("Should parse single line files", function () { const myParser = new X12parser(); - const testFile = - createReadStream("./test/testFiles/835/profeeOneLine.edi"); + const testFile = createReadStream( + "./test/testFiles/835/profeeOneLine.edi" + ); let counter = 0; // So ugly... This should be done nicer - const {finished} = require("./testFiles/835/profee-done"); + const { finished } = require("./testFiles/835/profee-done"); testFile.pipe(myParser).on("data", (data) => { assert.deepStrictEqual(data, finished[counter]); counter++; }); }); - it("Should parse multiple transactions (ISA) in a single file", function() { + it("Should parse multiple transactions (ISA) in a single file", function () { const myParser = new X12parser(); - const testFile = - createReadStream("./test/testFiles/835/profeeMultiple.edi"); + const testFile = createReadStream( + "./test/testFiles/835/profeeMultiple.edi" + ); let counter = 0; // So ugly... This should be done nicer - const {finished} = require("./testFiles/835/profee-done"); + const { finished } = require("./testFiles/835/profee-done"); testFile.pipe(myParser).on("data", (data) => { if (!finished[counter]) // Super ugly, but resets counter if undefined since it's same ISA @@ -98,17 +102,17 @@ describe("X12parser", function() { counter++; }); }); - it("Should parse multiline files without delimiter (LF/CRLF is delimiter)", - function() { - const myParser = new X12parser(); - const testFile = - createReadStream("./test/testFiles/835/multiLineNotDelimited.edi"); - let counter = 0; // So ugly... This should be done nicer - const {finished} = require("./testFiles/835/profee-done"); - testFile.pipe(myParser).on("data", (data) => { - assert.deepStrictEqual(data, finished[counter]); - counter++; - }); - }); + it("Should parse multiline files without delimiter (LF/CRLF is delimiter)", function () { + const myParser = new X12parser(); + const testFile = createReadStream( + "./test/testFiles/835/multiLineNotDelimited.edi" + ); + let counter = 0; // So ugly... This should be done nicer + const { finished } = require("./testFiles/835/profee-done"); + testFile.pipe(myParser).on("data", (data) => { + assert.deepStrictEqual(data, finished[counter]); + counter++; + }); + }); }); }); From 07971b4ccf6210a585883d81a7faadec618afd3b Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 Jul 2020 18:34:48 +0000 Subject: [PATCH 6/6] Restyled by whitespace --- Chain/CurveType.yaml | 2 +- docs/staking/index.html | 2 +- src/class/splitter.string.ts | 62 ++++++++++++++++++------------------ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Chain/CurveType.yaml b/Chain/CurveType.yaml index 3a40001..af2acef 100644 --- a/Chain/CurveType.yaml +++ b/Chain/CurveType.yaml @@ -13,7 +13,7 @@ # limitations under the License. description: | - CurveType is the type of cryptographic curve associated with a PublicKey. + CurveType is the type of cryptographic curve associated with a PublicKey. * secp256k1: SEC compressed - `33 bytes` (https://secg.org/sec1-v2.pdf#subsubsection.2.3.3) * edwards25519: `y (255-bits) || x-sign-bit (1-bit)` - `32 bytes` (https://ed25519.cr.yp.to/ed25519-20110926.pdf) diff --git a/docs/staking/index.html b/docs/staking/index.html index abbc6b8..6d02c49 100644 --- a/docs/staking/index.html +++ b/docs/staking/index.html @@ -1873,7 +1873,7 @@

> -
TradeDocs Form Generator 
+      
TradeDocs Form Generator
 

} separators * @return {number} The number of results found */ split$2(value: string | null, separators: number[] | null): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by - elements of a specified string or Unicode character array. This method is unsafe and can throw + * Returns a string array that contains the substrings in this instance that are delimited by + elements of a specified string or Unicode character array. This method is unsafe and can throw IndexOutOfRange exception if we overflow the buffer * * @instance @@ -60,8 +60,8 @@ interface StringSplitter { * @this StringSplitter * @memberof StringSplitter * @throws IndexOutOfRange - * @param {string} value - * @param {number} separator + * @param {string} value + * @param {number} separator * @param {System.StringSplitOptions} options * @return {number} The number of results found */ @@ -71,15 +71,15 @@ interface StringSplitter { options: System.StringSplitOptions ): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by + * Returns a string array that contains the substrings in this instance that are delimited by a specified string or Unicode character array. * * @instance * @public * @this StringSplitter * @memberof StringSplitter - * @param {string} value - * @param {string} separator + * @param {string} value + * @param {string} separator * @param {System.StringSplitOptions} options * @return {number} The number of results found */ @@ -89,8 +89,8 @@ interface StringSplitter { options: System.StringSplitOptions ): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by - elements of a specified string or Unicode character array. This method is unsafe and can throw + * Returns a string array that contains the substrings in this instance that are delimited by + elements of a specified string or Unicode character array. This method is unsafe and can throw IndexOutOfRange exception if we overflow the buffer * * @instance @@ -98,8 +98,8 @@ interface StringSplitter { * @this StringSplitter * @memberof StringSplitter * @throws IndexOutOfRange - * @param {string} value - * @param {Array.} separators + * @param {string} value + * @param {Array.} separators * @param {System.StringSplitOptions} options * @return {number} The number of results found */ @@ -109,7 +109,7 @@ interface StringSplitter { options: System.StringSplitOptions ): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by + * Returns a string array that contains the substrings in this instance that are delimited by elements of a specified string or Unicode character array. This method is safe and will automatically adjust the buffer if needed @@ -118,7 +118,7 @@ interface StringSplitter { * @public * @this StringSplitter * @memberof StringSplitter - * @param {string} value + * @param {string} value * @param {number} separator * @return {number} The number of results found */ @@ -136,21 +136,21 @@ interface StringSplitter { */ safeSplit$4(value: string | null, separator: string | null): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by - elements of a specified string or Unicode character array. This method is unsafe and can throw + * Returns a string array that contains the substrings in this instance that are delimited by + elements of a specified string or Unicode character array. This method is unsafe and can throw IndexOutOfRange exception if we overflow the buffer * * @instance * @public * @this StringSplitter * @memberof StringSplitter - * @param {string} value + * @param {string} value * @param {Array.} separators * @return {number} The number of results found */ safeSplit$2(value: string | null, separators: number[] | null): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by + * Returns a string array that contains the substrings in this instance that are delimited by elements of a specified string or Unicode character array. This method is safe and will automatically adjust the buffer if needed @@ -159,8 +159,8 @@ interface StringSplitter { * @public * @this StringSplitter * @memberof StringSplitter - * @param {string} value - * @param {number} separator + * @param {string} value + * @param {number} separator * @param {System.StringSplitOptions} options * @return {number} The number of results found */ @@ -187,8 +187,8 @@ interface StringSplitter { options: System.StringSplitOptions ): number; /** - * Returns a string array that contains the substrings in this instance that are delimited by - elements of a specified string or Unicode character array. This method is unsafe and can throw + * Returns a string array that contains the substrings in this instance that are delimited by + elements of a specified string or Unicode character array. This method is unsafe and can throw IndexOutOfRange exception if we overflow the buffer * * @instance @@ -196,8 +196,8 @@ interface StringSplitter { * @this StringSplitter * @memberof StringSplitter * @throws IndexOutOfRange - * @param {string} value - * @param {Array.} separators + * @param {string} value + * @param {Array.} separators * @param {System.StringSplitOptions} options * @return {number} The number of results found */