@icure/be-fhc-api 0.4.4 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/api/fhcDataAttributeServiceApi.d.ts +37 -0
  2. package/api/fhcDataAttributeServiceApi.js +65 -0
  3. package/api/fhcEhboxV3Api.d.ts +10 -0
  4. package/api/fhcEhboxV3Api.js +23 -0
  5. package/api/fhcSchematronApi.d.ts +29 -0
  6. package/api/fhcSchematronApi.js +53 -0
  7. package/fhcApi.d.ts +2 -6
  8. package/fhcApi.js +2 -7
  9. package/model/Acknowledgement.d.ts +19 -0
  10. package/model/Acknowledgement.js +9 -0
  11. package/model/ActivePattern.d.ts +18 -0
  12. package/model/ActivePattern.js +20 -0
  13. package/model/DaasResponse.d.ts +20 -0
  14. package/model/DaasResponse.js +9 -0
  15. package/model/DiagnosticReference.d.ts +16 -0
  16. package/model/DiagnosticReference.js +20 -0
  17. package/model/EhboxIdentifierType.d.ts +20 -0
  18. package/model/EhboxIdentifierType.js +9 -0
  19. package/model/FailedAssert.d.ts +22 -0
  20. package/model/FailedAssert.js +9 -0
  21. package/model/FiredRule.d.ts +18 -0
  22. package/model/FiredRule.js +20 -0
  23. package/model/ItemType.d.ts +2 -2
  24. package/model/KmehrRegimen.d.ts +16 -0
  25. package/model/KmehrRegimen.js +9 -0
  26. package/model/Mapstringstring.d.ts +15 -0
  27. package/model/Mapstringstring.js +20 -0
  28. package/model/MessageOperationResponse.d.ts +1 -0
  29. package/model/MessageStatusOperationResponse.d.ts +19 -0
  30. package/model/MessageStatusOperationResponse.js +9 -0
  31. package/model/Ns.d.ts +16 -0
  32. package/model/Ns.js +20 -0
  33. package/model/NsPrefixInAttributeValues.d.ts +16 -0
  34. package/model/NsPrefixInAttributeValues.js +20 -0
  35. package/model/SchematronOutput.d.ts +30 -0
  36. package/model/SchematronOutput.js +9 -0
  37. package/model/SchematronValidationResult.d.ts +20 -0
  38. package/model/SchematronValidationResult.js +9 -0
  39. package/model/SuccessfulReport.d.ts +22 -0
  40. package/model/SuccessfulReport.js +9 -0
  41. package/model/User.d.ts +17 -0
  42. package/model/User.js +20 -0
  43. package/model/models.d.ts +19 -0
  44. package/model/models.js +19 -0
  45. package/package.json +1 -1
  46. package/x-api/message-x-api.d.ts +0 -35
  47. package/x-api/message-x-api.js +0 -790
  48. package/x-api/receipt-x-api.d.ts +0 -10
  49. package/x-api/receipt-x-api.js +0 -42
  50. package/x-api/utils/efact-parser.d.ts +0 -234
  51. package/x-api/utils/efact-parser.js +0 -1121
  52. package/x-api/utils/efact-util.d.ts +0 -28
  53. package/x-api/utils/efact-util.js +0 -316
  54. package/x-api/utils/fhc-invoice-sender-util.d.ts +0 -3
  55. package/x-api/utils/fhc-invoice-sender-util.js +0 -31
  56. package/x-api/utils/fhc-patient-util.d.ts +0 -3
  57. package/x-api/utils/fhc-patient-util.js +0 -20
  58. package/x-api/utils/formatting-util.d.ts +0 -76
  59. package/x-api/utils/formatting-util.js +0 -218
  60. package/x-api/utils/hcp-util.d.ts +0 -16
  61. package/x-api/utils/hcp-util.js +0 -131
  62. package/x-api/utils/insurability-util.d.ts +0 -22
  63. package/x-api/utils/insurability-util.js +0 -56
  64. package/x-api/utils/uuid-encoder.d.ts +0 -44
  65. package/x-api/utils/uuid-encoder.js +0 -110
@@ -1,1121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EfactMessage920999Reader = exports.EfactMessage920098Reader = exports.EfactMessage920099Reader = exports.EfactMessage931000Reader = exports.EfactMessage920900Reader = exports.EfactMessageReader = void 0;
4
- class EfactMessageReader {
5
- constructor(message, debug = false) {
6
- this.log = (m, x) => {
7
- return x;
8
- };
9
- if (!message) {
10
- throw new Error("EfactMessageReader cannot be initialized to " + message);
11
- }
12
- this.message = message;
13
- if (debug) {
14
- this.log = console.log;
15
- }
16
- }
17
- get xades() {
18
- return this.message.xades;
19
- }
20
- get hashValue() {
21
- return this.message.hashValue;
22
- }
23
- readZone200(zone200) {
24
- let i = 0;
25
- this.log("responseType", zone200.zones[i].value);
26
- this.fileType = zone200.zones[i].value;
27
- i++;
28
- this.log("errorCode", zone200.zones[i++].value);
29
- this.log("N version format message premiere version 01", zone200.zones[i++].value);
30
- this.log("errorCode", zone200.zones[i++].value);
31
- this.log("Type message 12 prod/92 test", zone200.zones[i].value);
32
- const testMessage = zone200.zones[i].value === "92";
33
- i++;
34
- this.log("Code erreur", zone200.zones[i++].value);
35
- this.log("Statut message = code erreur si erreur !! IN - OUT !!", zone200.zones[i++].value);
36
- this.log("Code erreur", zone200.zones[i++].value);
37
- const healthcarePartyMessageReferenceNumber = this.log("Reference numerique message prestataire", zone200.zones[i++].value);
38
- this.log("Code erreur", zone200.zones[i++].value);
39
- const oaMessageReference = this.log("Reference message OA", zone200.zones[i++].value);
40
- this.log("Code erreur", zone200.zones[i++].value);
41
- this.log("reserve", zone200.zones[i++].value);
42
- if (zone200.zones.length !== i) {
43
- throw Error("Zone 200: The parsing is not matching the available number of zones.");
44
- }
45
- return {
46
- errorDetail: zone200.errorDetail,
47
- isTest: testMessage,
48
- hcpMessageRef: healthcarePartyMessageReferenceNumber,
49
- mutualityMessageReference: oaMessageReference
50
- };
51
- }
52
- readZone300(zone300) {
53
- let i = 0;
54
- this.log("Lien T10 Z22&23 Annee et mois facturation", zone300.zones[i++].value);
55
- this.log("Code erreur", zone300.zones[i++].value);
56
- const sendingNumber = this.log("Numro d'envoi", zone300.zones[i++].value);
57
- this.log("Code erreur", zone300.zones[i++].value);
58
- this.log("Lien T10 Z25 Date cration facture", zone300.zones[i++].value);
59
- this.log("Code erreur", zone300.zones[i++].value);
60
- const invoiceReference = this.log("Reference facture", zone300.zones[i++].value);
61
- this.log("Code erreur", zone300.zones[i++].value);
62
- this.log("Lien T10 Z4 Numro version instructions", zone300.zones[i++].value);
63
- this.log("Code erreur", zone300.zones[i++].value);
64
- const oaContactLastName = this.log("Nom personne contact OA", zone300.zones[i++].value);
65
- this.log("Code erreur", zone300.zones[i++].value);
66
- const oaContactFirstName = this.log("Prenom personne de contact OA", zone300.zones[i++].value);
67
- this.log("Code erreur", zone300.zones[i++].value);
68
- const oaContactPhoneNumber = this.log("Numero telephone personne contact OA", zone300.zones[i++].value);
69
- this.log("Code erreur", zone300.zones[i++].value);
70
- const invoiceType = this.log("Type de facture", zone300.zones[i++].value);
71
- this.log("Code erreur", zone300.zones[i++].value);
72
- const invoiceMode = this.log("Mode facturation", zone300.zones[i++].value);
73
- this.log("Code erreur", zone300.zones[i++].value);
74
- const errorPercentage = this.log("Pourcentage erreurs", zone300.zones[i++].value);
75
- this.log("Code erreur", zone300.zones[i++].value);
76
- const invoiceRejectionType = this.log("Type refus facturation", zone300.zones[i++].value);
77
- this.log("Code erreur", zone300.zones[i++].value);
78
- this.log("reserve", zone300.zones[i++].value);
79
- if (zone300.zones.length !== i) {
80
- throw Error("Zone 300: The parsing is not matching the available number of zones.");
81
- }
82
- return {
83
- errorDetail: zone300.errorDetail,
84
- sendingNumber: sendingNumber,
85
- invoiceReference: invoiceReference,
86
- mutualityContactLastName: oaContactLastName,
87
- mutualityContactFirstName: oaContactFirstName,
88
- mutualityContactPhoneNumber: oaContactPhoneNumber,
89
- invoiceType: invoiceType,
90
- invoiceMode: invoiceMode,
91
- errorPercentage: errorPercentage,
92
- invoiceRejectionType: invoiceRejectionType
93
- };
94
- }
95
- readZone300Stub(zone300) {
96
- let i = 0;
97
- const messageType = this.log("Nom du message visé par cette communication", zone300.zones[i++].value);
98
- this.log("Code erreur", zone300.zones[i++].value);
99
- this.log("reserve", zone300.zones[i++].value);
100
- if (zone300.zones.length !== i) {
101
- throw Error("Zone 300: The parsing is not matching the available number of zones.");
102
- }
103
- return {
104
- messageType
105
- };
106
- }
107
- readZone300Short(zone300) {
108
- let i = 0;
109
- this.log("Lien T10 Z22&23 Annee et mois facturation", zone300.zones[i++].value);
110
- this.log("Code erreur", zone300.zones[i++].value);
111
- const sendingNumber = this.log("Numro d'envoi", zone300.zones[i++].value);
112
- this.log("Code erreur", zone300.zones[i++].value);
113
- this.log("Lien T10 Z25 Date cration facture", zone300.zones[i++].value);
114
- this.log("Code erreur", zone300.zones[i++].value);
115
- const invoiceReference = this.log("Reference facture", zone300.zones[i++].value);
116
- this.log("Code erreur", zone300.zones[i++].value);
117
- this.log("Lien T10 Z4 Numro version instructions", zone300.zones[i++].value);
118
- this.log("Code erreur", zone300.zones[i++].value);
119
- const oaContactLastName = this.log("Nom personne contact OA", zone300.zones[i++].value);
120
- this.log("Code erreur", zone300.zones[i++].value);
121
- const oaContactFirstName = this.log("Prnom personne de contact OA", zone300.zones[i++].value);
122
- this.log("Code erreur", zone300.zones[i++].value);
123
- const oaContactPhoneNumber = this.log("Numro telephone personne contact OA", zone300.zones[i++].value);
124
- this.log("Code erreur", zone300.zones[i++].value);
125
- const invoiceType = this.log("Type de facture", zone300.zones[i++].value);
126
- this.log("Code erreur", zone300.zones[i++].value);
127
- const invoiceMode = this.log("Mode facturation", zone300.zones[i++].value);
128
- this.log("Code erreur", zone300.zones[i++].value);
129
- this.log("reserve", zone300.zones[i++].value);
130
- if (zone300.zones.length !== i) {
131
- throw Error("Zone 300: The parsing is not matching the available number of zones.");
132
- }
133
- return {
134
- errorDetail: zone300.errorDetail,
135
- sendingNumber: sendingNumber,
136
- invoiceReference: invoiceReference,
137
- mutualityContactLastName: oaContactLastName,
138
- mutualityContactFirstName: oaContactFirstName,
139
- mutualityContactPhoneNumber: oaContactPhoneNumber,
140
- invoiceType: invoiceType,
141
- invoiceMode: invoiceMode
142
- };
143
- }
144
- readET10(et10) {
145
- const etNumber = 10;
146
- let i = 0;
147
- this.log("EnregistrementType", et10.zones[i].value);
148
- if (et10.zones[i].value !== etNumber.toString()) {
149
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et10)}`);
150
- }
151
- i++;
152
- this.log("NumeroOrdreEnregistrement", et10.zones[i++].value);
153
- this.log("NombreNumerosComptesFinanciers", et10.zones[i++].value);
154
- const fileVersion = this.log("VersionFichier", et10.zones[i++].value);
155
- const financialAccountNumber1 = this.log("NumeroCompteFinancierAPartie1et2", et10.zones[i++].value);
156
- this.log("Reserve", et10.zones[i++].value);
157
- const sendingNumber = this.log("NumeroDeLenvoi", et10.zones[i++].value);
158
- const financialAccountNumber2 = this.log("NumeroCompteFinancierB", et10.zones[i++].value);
159
- this.log("Reserve", et10.zones[i++].value);
160
- const deletionCodePaperInvoice = this.log("CodeSuppressionFacturePapier", et10.zones[i++].value);
161
- this.log("CodeFichierDeDecompte", et10.zones[i++].value);
162
- this.log("Reserve", et10.zones[i++].value);
163
- this.log("Reserve", et10.zones[i++].value);
164
- this.log("ContenuDeLaFacturation", et10.zones[i++].value);
165
- const thirdPartyNumber = this.log("NumeroTiersPayant", et10.zones[i++].value);
166
- const accreditationCinNumber = this.log("NumeroDaccreditationCin", et10.zones[i++].value);
167
- this.log("Reserve", et10.zones[i++].value);
168
- this.log("Reserve", et10.zones[i++].value);
169
- this.log("Reserve", et10.zones[i++].value);
170
- this.log("Reserve", et10.zones[i++].value);
171
- this.log("Reserve", et10.zones[i++].value);
172
- this.log("Reserve", et10.zones[i++].value);
173
- const invoicingYear = this.log("AnneeDeFacturation", et10.zones[i++].value);
174
- const invoicingMonth = this.log("MoisDeFacturation", et10.zones[i++].value);
175
- this.log("Reserve", et10.zones[i++].value);
176
- this.log("DateDeCreationPartie1et2", et10.zones[i++].value);
177
- this.log("BCE", et10.zones[i++].value);
178
- const invoiceReference = this.log("ReferenceDeLetablissement", et10.zones[i++].value);
179
- this.log("Reserve", et10.zones[i++].value);
180
- this.log("Reserve", et10.zones[i++].value);
181
- const bic1 = this.log("BicCompteFinancierAPartie1_2_3et4", et10.zones[i++].value);
182
- this.log("Reserve", et10.zones[i++].value);
183
- const iban1 = this.log("IbanCompteFinancierAPartie1_2_3_4_5et6", et10.zones[i++].value);
184
- this.log("Reserve", et10.zones[i++].value);
185
- const bic2 = this.log("BicCompteFinancierB", et10.zones[i++].value);
186
- this.log("Reserve", et10.zones[i++].value);
187
- this.log("Reserve", et10.zones[i++].value);
188
- this.log("Reserve", et10.zones[i++].value);
189
- this.log("Reserve", et10.zones[i++].value);
190
- this.log("Reserve", et10.zones[i++].value);
191
- this.log("Reserve", et10.zones[i++].value);
192
- const iban2 = this.log("IbanCompteFinancierBPartie1_2_3et4", et10.zones[i++].value);
193
- this.log("Reserve", et10.zones[i++].value);
194
- this.log("Reserve", et10.zones[i++].value);
195
- this.log("Reserve", et10.zones[i++].value);
196
- this.log("Reserve", et10.zones[i++].value);
197
- this.log("Reserve", et10.zones[i++].value);
198
- this.log("Reserve", et10.zones[i++].value);
199
- this.log("Reserve", et10.zones[i++].value);
200
- this.log("Reserve", et10.zones[i++].value);
201
- const recordControlNumber = this.log("Chiffres de controle de l'enregistrement", et10.zones[i++].value);
202
- if (i !== et10.zones.length) {
203
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
204
- }
205
- return {
206
- errorDetail: et10.errorDetail,
207
- fileVersion,
208
- financialAccountNumber1,
209
- sendingNumber,
210
- financialAccountNumber2,
211
- deletionCodePaperInvoice,
212
- thirdPartyNumber,
213
- accreditationCinNumber,
214
- invoicingYear,
215
- invoicingMonth,
216
- invoiceReference,
217
- bic1,
218
- iban1,
219
- bic2,
220
- iban2,
221
- recordControlNumber
222
- };
223
- }
224
- readET20(et20) {
225
- const etNumber = 20;
226
- let i = 0;
227
- this.log("EnregistrementDeType20", et20.zones[i].value);
228
- if (et20.zones[i].value !== etNumber.toString()) {
229
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et20)}`);
230
- }
231
- i++;
232
- this.log("NumeroDordreDeLenregistrement", et20.zones[i++].value);
233
- this.log("AutorisationTiersPayant", et20.zones[i++].value);
234
- this.log("HeureDadmission", et20.zones[i++].value);
235
- this.log("DateDadmission", et20.zones[i++].value);
236
- this.log("DateDeSortiePartie1", et20.zones[i++].value);
237
- this.log("DateDeSortiePartie2", et20.zones[i++].value);
238
- this.log("NumeroMutualiteDaffiliation", et20.zones[i++].value);
239
- this.log("IdentificationBeneficiairePartie1et2", et20.zones[i++].value);
240
- this.log("SexeBeneficiaire", et20.zones[i++].value);
241
- this.log("TypeFacture", et20.zones[i++].value);
242
- this.log("TypeDeFacturation", et20.zones[i++].value);
243
- this.log("Reserve", et20.zones[i++].value);
244
- this.log("Service721Bis", et20.zones[i++].value);
245
- this.log("NumeroDeLetablissementQuiFacture", et20.zones[i++].value);
246
- this.log("EtablissementDeSejour", et20.zones[i++].value);
247
- this.log("CodeLeveeDelaiDePrescription", et20.zones[i++].value);
248
- this.log("CausesDuTraitement", et20.zones[i++].value);
249
- this.log("NumeroMutualiteDeDestination", et20.zones[i++].value);
250
- this.log("NumeroDadmission", et20.zones[i++].value);
251
- this.log("DateAccordTraitementPartie1et2", et20.zones[i++].value);
252
- this.log("HeureDeSortie", et20.zones[i++].value);
253
- this.log("Reserve", et20.zones[i++].value);
254
- this.log("NumeroDeLaFactureIndividuellePartie1et2", et20.zones[i++].value);
255
- this.log("ApplicationFranchiseSociale", et20.zones[i++].value);
256
- const ct1ct2 = this.log("Ct1Ct2", et20.zones[i++].value);
257
- const reference = this.log("ReferenceDeLetablissement", et20.zones[i++].value);
258
- this.log("NumeroDeFacturePrecedentePartie1_2et3", et20.zones[i++].value);
259
- const recipientIdentifierFlag = this.log("FlagIdentificationDuBeneficiaire", et20.zones[i++].value);
260
- this.log("Reserve", et20.zones[i++].value);
261
- this.log("NumeroEnvoiPrecedentPartie1_2et3", et20.zones[i++].value);
262
- this.log("NumeroMutualiteFacturationPrecedente", et20.zones[i++].value);
263
- this.log("Reserve", et20.zones[i++].value);
264
- const previousInvoicingYearMonth = this.log("AnneeEtMoisDeFacturationPrecedente", et20.zones[i++].value);
265
- i++;
266
- this.log("DonneesDeReferenceReseauOuCarteSisPartie1_2_3_4et5", et20.zones[i++].value);
267
- this.log("Reserve", et20.zones[i++].value);
268
- this.log("Date de facturation", et20.zones[i++].value);
269
- this.log("Reserve", et20.zones[i++].value);
270
- i++;
271
- this.log("ReferenceMutualiteNumeroCompteFinancierBPartie1_2et3", et20.zones[i++].value);
272
- this.log("Reserve", et20.zones[i++].value);
273
- const insurabilityStartDate = this.log("DateDebutAssurabilite", et20.zones[i++].value);
274
- const insurabilityEndDate = this.log("DateFinAssurabilite", et20.zones[i++].value);
275
- this.log("DateCommunicationInformation", et20.zones[i++].value);
276
- this.log("MafAnneeEnCours", et20.zones[i++].value);
277
- this.log("MafAnneeEnCours2", et20.zones[i++].value);
278
- this.log("Reserve", et20.zones[i++].value);
279
- this.log("Reserve", et20.zones[i++].value);
280
- this.log("Chiffres de controle de l'enregistrement", et20.zones[i++].value);
281
- if (i !== et20.zones.length) {
282
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
283
- }
284
- return {
285
- errorDetail: et20.errorDetail,
286
- ct1ct2,
287
- reference,
288
- recipientIdentifierFlag,
289
- previousInvoicingYearMonth,
290
- insurabilityStartDate,
291
- insurabilityEndDate
292
- };
293
- }
294
- readET50(et50) {
295
- const etNumber = 50;
296
- let i = 0;
297
- this.log("EnregistrementDeType50", et50.zones[i].value);
298
- if (et50.zones[i].value !== etNumber.toString()) {
299
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et50)}`);
300
- }
301
- i++;
302
- const recordOrderNumber = this.log("NumeroDordreDeLenregistrement", et50.zones[i++].value);
303
- this.log("NormePrestationPourcentage", et50.zones[i++].value);
304
- this.log("CodeNomenclatureOuPseudoCodeNomenclature", et50.zones[i++].value);
305
- this.log("DatePremierePrestationEffectuee", et50.zones[i++].value);
306
- this.log("DateDernierePrestationEffectueePartie1et2", et50.zones[i++].value);
307
- this.log("NumeroMutualiteDaffiliation", et50.zones[i++].value);
308
- this.log("IdentificationBeneficiairePartie1et2", et50.zones[i++].value);
309
- const sex = this.log("SexeBeneficiaire", et50.zones[i++].value);
310
- this.log("Accouchement", et50.zones[i++].value);
311
- this.log("ReferenceNumeroDeCompteFinancier", et50.zones[i++].value);
312
- this.log("NuitWeekEndJourFerie", et50.zones[i++].value);
313
- this.log("CodeService", et50.zones[i++].value);
314
- this.log("LieuDePrestation", et50.zones[i++].value);
315
- this.log("IdentificationDuDispensateur", et50.zones[i++].value);
316
- this.log("NormeDispensateur", et50.zones[i++].value);
317
- this.log("PrestationRelativePartie1et2", et50.zones[i++].value);
318
- const montantInterventionAssurance = this.log("SigneMontantInterventionDeLassurance", et50.zones[i++].value);
319
- this.log("DatePrescriptionPartie1et2", et50.zones[i++].value);
320
- const units = this.log("SigneNombreDunites", et50.zones[i++].value);
321
- this.log("NombreDeCoupes", et50.zones[i++].value);
322
- const prescriberNihii = this.log("IdentificationPrescripteurPartie1et2", et50.zones[i++].value);
323
- this.log("NormePrescripteur", et50.zones[i++].value);
324
- this.log("Z27SigneInterventionPersonnellePatient", et50.zones[i++].value);
325
- const itemReference = this.log("ReferenceDeLetablissement", et50.zones[i++].value);
326
- const tooth = this.log("DentTraitee", et50.zones[i++].value);
327
- this.log("SigneMontantSupplementPartie1et2", et50.zones[i++].value);
328
- const thirdPartyException = this.log("ExceptionTiersPayant", et50.zones[i++].value);
329
- this.log("CodeFacturationInterventionPersonnelleOuSupplement", et50.zones[i++].value);
330
- const treatedMember = this.log("MembreTraite", et50.zones[i++].value);
331
- this.log("PrestataireConventionne", et50.zones[i++].value);
332
- this.log("HeureDePrestationPartie1et2", et50.zones[i++].value);
333
- this.log("IdentificationAdministrateurDuSang", et50.zones[i++].value);
334
- this.log("NumeroDeLattestationDadministrationPartie1et2", et50.zones[i++].value);
335
- this.log("NumeroBonDeDelivranceOuSacPartie1et2", et50.zones[i++].value);
336
- this.log("CodeImplantPartie1", et50.zones[i++].value);
337
- this.log("LibelleDuProduitPartie1et2", et50.zones[i++].value);
338
- this.log("NormePlafond", et50.zones[i++].value);
339
- this.log("DateAccordPrestation", et50.zones[i++].value);
340
- this.log("Transplantation", et50.zones[i++].value);
341
- this.log("identification de l'aide soignant", et50.zones[i++].value);
342
- this.log("Reserve", et50.zones[i++].value);
343
- this.log("SiteHospitalier", et50.zones[i++].value);
344
- this.log("IdentificationAssociationBassinDeSoins", et50.zones[i++].value);
345
- this.log("numero de course (partie 1 et 2)", et50.zones[i++].value);
346
- this.log("Reserve", et50.zones[i++].value);
347
- this.log("CodeNotificationImplantPartie1et2", et50.zones[i++].value);
348
- this.log("code d'enregistrement Qermid (partie 1, 2 et 3)", et50.zones[i++].value);
349
- this.log("Reserve", et50.zones[i++].value);
350
- this.log("Chiffres de controle de l'enregistrement", et50.zones[i++].value);
351
- if (i !== et50.zones.length) {
352
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
353
- }
354
- return {
355
- errorDetail: et50.errorDetail,
356
- recordOrderNumber,
357
- sex,
358
- montantInterventionAssurance,
359
- units,
360
- prescriberNihii,
361
- itemReference,
362
- tooth,
363
- thirdPartyException,
364
- treatedMember
365
- };
366
- }
367
- readET51(et51) {
368
- const etNumber = 51;
369
- let i = 0;
370
- this.log("EnregistrementType", et51.zones[i].value);
371
- if (et51.zones[i].value !== etNumber.toString()) {
372
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et51)}`);
373
- }
374
- i++;
375
- const recordOrderNumber = this.log("numero d'ordre de l'enregistrement", et51.zones[i++].value);
376
- this.log("reserve", et51.zones[i++].value);
377
- const prestationCode = this.log("code nomenclature ou pseudo-code nomenclature", et51.zones[i++].value);
378
- const prestationDate = this.log("date prestation", et51.zones[i++].value);
379
- this.log("reserve", et51.zones[i++].value);
380
- this.log("reserve", et51.zones[i++].value);
381
- this.log("reserve", et51.zones[i++].value);
382
- const recipientIdentifier = this.log("identification beneficiaire", et51.zones[i++].value);
383
- this.log("reserve", et51.zones[i++].value);
384
- this.log("reserve", et51.zones[i++].value);
385
- this.log("reserve", et51.zones[i++].value);
386
- this.log("reserve", et51.zones[i++].value);
387
- this.log("reserve", et51.zones[i++].value);
388
- this.log("reserve", et51.zones[i++].value);
389
- const careProviderIdentifier = this.log("identification du dispensateur", et51.zones[i++].value);
390
- this.log("reserve", et51.zones[i++].value);
391
- this.log("reserve", et51.zones[i++].value);
392
- this.log("reserve", et51.zones[i++].value);
393
- const reimbursementAmount = this.log("signe + montant intervention de l'assurance", et51.zones[i++].value);
394
- this.log("reserve", et51.zones[i++].value);
395
- this.log("reserve", et51.zones[i++].value);
396
- this.log("reserve", et51.zones[i++].value);
397
- this.log("reserve", et51.zones[i++].value);
398
- this.log("reserve", et51.zones[i++].value);
399
- this.log("reserve", et51.zones[i++].value);
400
- this.log("reserve", et51.zones[i++].value);
401
- const ct1ct2 = this.log("ct1 + ct2", et51.zones[i++].value);
402
- this.log("reserve", et51.zones[i++].value);
403
- this.log("reserve", et51.zones[i++].value);
404
- this.log("reserve", et51.zones[i++].value);
405
- this.log("reserve", et51.zones[i++].value);
406
- this.log("reserve", et51.zones[i++].value);
407
- this.log("reserve", et51.zones[i++].value);
408
- this.log("reserve", et51.zones[i++].value);
409
- this.log("reserve", et51.zones[i++].value);
410
- this.log("reserve", et51.zones[i++].value);
411
- this.log("reserve", et51.zones[i++].value);
412
- this.log("reserve", et51.zones[i++].value);
413
- this.log("reserve", et51.zones[i++].value);
414
- this.log("reserve", et51.zones[i++].value);
415
- this.log("reserve", et51.zones[i++].value);
416
- const networkReferenceData = this.log("42,43a,43b,44,donnees de reference reseau", et51.zones[i++].value);
417
- this.log("reserve", et51.zones[i++].value);
418
- this.log("reserve", et51.zones[i++].value);
419
- this.log("reserve", et51.zones[i++].value);
420
- this.log("reserve", et51.zones[i++].value);
421
- this.log("reserve", et51.zones[i++].value);
422
- this.log("reserve", et51.zones[i++].value);
423
- this.log("reserve", et51.zones[i++].value);
424
- this.log("reserve", et51.zones[i++].value);
425
- this.log("reserve", et51.zones[i++].value);
426
- this.log("reserve", et51.zones[i++].value);
427
- const infoCommunicationDate = this.log("date communication information", et51.zones[i++].value);
428
- this.log("reserve", et51.zones[i++].value);
429
- this.log("reserve", et51.zones[i++].value);
430
- this.log("reserve", et51.zones[i++].value);
431
- this.log("reserve", et51.zones[i++].value);
432
- this.log("reserve", et51.zones[i++].value);
433
- const recordControlNumber = this.log("Chiffres de controle de l'enregistrement", et51.zones[i++].value);
434
- if (i !== et51.zones.length) {
435
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
436
- }
437
- return {
438
- errorDetail: et51.errorDetail,
439
- recordOrderNumber,
440
- prestationCode,
441
- prestationDate,
442
- recipientIdentifier,
443
- careProviderIdentifier,
444
- reimbursementAmount,
445
- ct1ct2,
446
- networkReferenceData,
447
- infoCommunicationDate,
448
- recordControlNumber
449
- };
450
- }
451
- readET52(et52) {
452
- const etNumber = 52;
453
- let i = 0;
454
- if (et52.zones[i].value !== etNumber.toString()) {
455
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et52)}`);
456
- }
457
- this.log("Enregistrement de type 52", et52.zones[i++].value);
458
- const recordOrderNumber = this.log("Numero d'ordre de l'enregistrement", et52.zones[i++].value);
459
- this.log("reserve", et52.zones[i++].value);
460
- const nomenCode = this.log("Code nomenclature", et52.zones[i++].value);
461
- const prestationDate = this.log("Date de prestation", et52.zones[i++].value);
462
- const eidDate = this.log("Date de lecture document identite electronique (1 et 2)", et52.zones[i++].value);
463
- this.log("reserve", et52.zones[i++].value);
464
- this.log("Numero NISS du patient sauf en cas de convention internationale ou nouveaux-nes (1 et 2)", et52.zones[i].value);
465
- const patientINSS = et52.zones[i].value;
466
- i++;
467
- this.log("reserve", et52.zones[i++].value);
468
- const eidSupportType = this.log("Type de support document identite electronique", et52.zones[i++].value);
469
- const eidReadingType = this.log("Type de lecture document identite electronique", et52.zones[i++].value);
470
- const eidReadingHour = this.log("Heure de lecture document identite electronique (1 et 2)", et52.zones[i++].value);
471
- this.log("reserve", et52.zones[i++].value);
472
- const nihii = this.log("Numero INAMI", et52.zones[i++].value);
473
- this.log("reserve", et52.zones[i++].value);
474
- this.log("Chiffres de controle de l'enregistrement", et52.zones[i++].value);
475
- if (i !== et52.zones.length) {
476
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
477
- }
478
- return {
479
- errorDetail: et52.errorDetail,
480
- recordOrderNumber,
481
- nomenCode,
482
- prestationDate,
483
- eidDate,
484
- patientINSS,
485
- eidSupportType,
486
- eidReadingType,
487
- eidReadingHour,
488
- nihii
489
- };
490
- }
491
- readET80(et80) {
492
- const etNumber = 80;
493
- let i = 0;
494
- this.log("EnregistrementDeType80", et80.zones[i].value);
495
- if (et80.zones[i].value !== etNumber.toString()) {
496
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et80)}`);
497
- }
498
- i++;
499
- this.log("NumeroDordreDeLenregistrement", et80.zones[i++].value);
500
- this.log("Reserve", et80.zones[i++].value);
501
- this.log("HeureDadmission", et80.zones[i++].value);
502
- this.log("DateDadmission", et80.zones[i++].value);
503
- this.log("DateDeSortiePartie1et2", et80.zones[i++].value);
504
- this.log("NumeroMutualiteDaffiliation", et80.zones[i++].value);
505
- const recipientIdentifier = this.log("IdentificationBeneficiairePartie1", et80.zones[i++].value);
506
- this.log("SexeBeneficiaire", et80.zones[i++].value);
507
- this.log("TypeFacture", et80.zones[i++].value);
508
- this.log("Reserve", et80.zones[i++].value);
509
- this.log("Reserve", et80.zones[i++].value);
510
- this.log("Service721Bis", et80.zones[i++].value);
511
- this.log("NumeroDeLetablissementQuiFacture", et80.zones[i++].value);
512
- this.log("SigneMontantDeCompteFinancierB", et80.zones[i++].value);
513
- this.log("Reserve", et80.zones[i++].value);
514
- this.log("CausesDuTraitement", et80.zones[i++].value);
515
- this.log("NumeroMutualiteDeDestination", et80.zones[i++].value);
516
- this.log("SigneMontantDeCompteFinancierA", et80.zones[i++].value);
517
- this.log("DateDeLaFacturePartie1et2", et80.zones[i++].value);
518
- this.log("HeureDeSortie", et80.zones[i++].value);
519
- this.log("Reserve", et80.zones[i++].value);
520
- this.log("NumeroDeLaFactureIndividuellePartie1et2", et80.zones[i++].value);
521
- this.log("Reserve", et80.zones[i++].value);
522
- this.log("SigneInterventionPersonnellePatient", et80.zones[i++].value);
523
- this.log("ReferenceDeLetablissement", et80.zones[i++].value);
524
- this.log("Reserve", et80.zones[i++].value);
525
- this.log("Z27SigneMontantSupplementPartie1et2", et80.zones[i++].value);
526
- this.log("FlagIdentificationDuBeneficiaire", et80.zones[i++].value);
527
- this.log("Reserve", et80.zones[i++].value);
528
- this.log("Reserve", et80.zones[i++].value);
529
- this.log("Reserve", et80.zones[i++].value);
530
- this.log("Reserve", et80.zones[i++].value);
531
- this.log("Reserve", et80.zones[i++].value);
532
- this.log("SigneAcompteNumeroCompteFinancierA", et80.zones[i++].value);
533
- this.log("Reserve", et80.zones[i++].value);
534
- this.log("Reserve", et80.zones[i++].value);
535
- this.log("Reserve", et80.zones[i++].value);
536
- this.log("Reserve", et80.zones[i++].value);
537
- this.log("Reserve", et80.zones[i++].value);
538
- this.log("Reserve", et80.zones[i++].value);
539
- this.log("Reserve", et80.zones[i++].value);
540
- this.log("Reserve", et80.zones[i++].value);
541
- this.log("Reserve", et80.zones[i++].value);
542
- this.log("Reserve", et80.zones[i++].value);
543
- this.log("Reserve", et80.zones[i++].value);
544
- this.log("Reserve", et80.zones[i++].value);
545
- this.log("Reserve", et80.zones[i++].value);
546
- this.log("Reserve", et80.zones[i++].value);
547
- this.log("Reserve", et80.zones[i++].value);
548
- this.log("Reserve", et80.zones[i++].value);
549
- this.log("Reserve", et80.zones[i++].value);
550
- this.log("Reserve", et80.zones[i++].value);
551
- this.log("Reserve", et80.zones[i++].value);
552
- this.log("Reserve", et80.zones[i++].value);
553
- this.log("Reserve", et80.zones[i++].value);
554
- this.log("Reserve", et80.zones[i++].value);
555
- this.log("chiffres de controle de la facture", et80.zones[i++].value);
556
- this.log("Chiffres de controle de l'enregistrement", et80.zones[i++].value);
557
- if (i !== et80.zones.length) {
558
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
559
- }
560
- return {
561
- errorDetail: et80.errorDetail,
562
- recipientIdentifier
563
- };
564
- }
565
- readET90(et90) {
566
- const etNumber = 90;
567
- let i = 0;
568
- if (et90.zones[i].value !== etNumber.toString()) {
569
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et90)}`);
570
- }
571
- this.log("EnregistrementDeType90", et90.zones[i++].value);
572
- this.log("NumeroDordreDeLenregistrement", et90.zones[i++].value);
573
- this.log("Reserve", et90.zones[i++].value);
574
- this.log("Reserve", et90.zones[i++].value);
575
- const financialAccountNumber1 = this.log("NumeroCompteFinancierAPartie1et2", et90.zones[i++].value);
576
- this.log("Reserve", et90.zones[i++].value);
577
- const sendingNumber = this.log("NumeroDenvoi", et90.zones[i++].value);
578
- const financialAccountNumber2 = this.log("NumeroCompteFinancierB", et90.zones[i++].value);
579
- this.log("Reserve", et90.zones[i++].value);
580
- this.log("Reserve", et90.zones[i++].value);
581
- this.log("Reserve", et90.zones[i++].value);
582
- this.log("Reserve", et90.zones[i++].value);
583
- this.log("Reserve", et90.zones[i++].value);
584
- this.log("Reserve", et90.zones[i++].value);
585
- const thirdPartyNumber = this.log("NumeroTiersPayant", et90.zones[i++].value);
586
- this.log("SigneMontantTotalNumeroCompteFinancierB", et90.zones[i++].value);
587
- this.log("Reserve", et90.zones[i++].value);
588
- this.log("Reserve", et90.zones[i++].value);
589
- this.log("Reserve", et90.zones[i++].value);
590
- const signeAndTotalAmountCptA = this.log("SigneMontantTotalNumeroCompteFinancierA", et90.zones[i++].value);
591
- this.log("Reserve", et90.zones[i++].value);
592
- this.log("Reserve", et90.zones[i++].value);
593
- const invoicingYear = this.log("AnneeDeFacturation", et90.zones[i++].value);
594
- const invoicingMonth = this.log("MoisDeFacturation", et90.zones[i++].value);
595
- this.log("Reserve", et90.zones[i++].value);
596
- this.log("Reserve", et90.zones[i++].value);
597
- this.log("Reserve", et90.zones[i++].value);
598
- const cbe = this.log("BCE", et90.zones[i++].value);
599
- const invoiceReference = this.log("ReferenceDeLetablissement", et90.zones[i++].value);
600
- this.log("Reserve", et90.zones[i++].value);
601
- this.log("Reserve", et90.zones[i++].value);
602
- const bic1 = this.log("BicCompteFinancierAPartie1_2_3et4", et90.zones[i++].value);
603
- this.log("Reserve", et90.zones[i++].value);
604
- const iban1 = this.log("IbanCompteFinancierAPartie1_2_3_4_5et6", et90.zones[i++].value);
605
- this.log("Reserve", et90.zones[i++].value);
606
- const bic2 = this.log("BicCompteFinancierB", et90.zones[i++].value);
607
- this.log("Reserve", et90.zones[i++].value);
608
- this.log("Reserve", et90.zones[i++].value);
609
- this.log("Reserve", et90.zones[i++].value);
610
- this.log("Reserve", et90.zones[i++].value);
611
- this.log("Reserve", et90.zones[i++].value);
612
- this.log("Reserve", et90.zones[i++].value);
613
- const iban2 = this.log("IbanCompteFinancierBPartie1_2_3et4", et90.zones[i++].value);
614
- this.log("Reserve", et90.zones[i++].value);
615
- this.log("Reserve", et90.zones[i++].value);
616
- this.log("Reserve", et90.zones[i++].value);
617
- this.log("Reserve", et90.zones[i++].value);
618
- this.log("Reserve", et90.zones[i++].value);
619
- this.log("Reserve", et90.zones[i++].value);
620
- this.log("Reserve", et90.zones[i++].value);
621
- const invoiceControlNumber = this.log("chiffres de controle de la facture", et90.zones[i++].value);
622
- const recordControlNumber = this.log("Chiffres de controle de l'enregistrement", et90.zones[i++].value);
623
- if (i !== et90.zones.length) {
624
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
625
- }
626
- return {
627
- errorDetail: et90.errorDetail,
628
- financialAccountNumber1,
629
- sendingNumber,
630
- financialAccountNumber2,
631
- thirdPartyNumber,
632
- signeAndTotalAmountCptA,
633
- invoicingYear,
634
- invoicingMonth,
635
- invoiceReference,
636
- cbe,
637
- bic1,
638
- iban1,
639
- bic2,
640
- iban2,
641
- invoiceControlNumber,
642
- recordControlNumber
643
- };
644
- }
645
- readET91(et91) {
646
- const etNumber = 91;
647
- let i = 0;
648
- if (et91.zones[i].value !== etNumber.toString()) {
649
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et91)}`);
650
- }
651
- this.log("Type", et91.zones[i++].value);
652
- this.log("Code erreur", et91.zones[i++].value);
653
- this.log("Lien T10 N mutualit", et91.zones[i++].value);
654
- this.log("Code erreur", et91.zones[i++].value);
655
- this.log("n facture recapitulative", et91.zones[i++].value);
656
- this.log("Code erreur", et91.zones[i++].value);
657
- this.log("Signe montant demand compte A", et91.zones[i++].value);
658
- const askedAmountForAccount1 = this.log("Montant demand compte A", et91.zones[i++].value);
659
- this.log("Code erreur", et91.zones[i++].value);
660
- this.log("Signe montant demand compte B", et91.zones[i++].value);
661
- const askedAmountForAccount2 = this.log("Montant demand compte B", et91.zones[i++].value);
662
- this.log("Code erreur", et91.zones[i++].value);
663
- this.log("Signe Montant demand A + B", et91.zones[i++].value);
664
- const totalAskedAmount = this.log("Montant demand compte A + B = lien Cpt A", et91.zones[i++].value);
665
- this.log("Code erreur", et91.zones[i++].value);
666
- const numberOfRecordBundle = this.log("Nombre d'enregistrement", et91.zones[i++].value);
667
- this.log("Code erreur", et91.zones[i++].value);
668
- this.log("Lien T80 Z98 N contrle par mutuelle", et91.zones[i++].value);
669
- this.log("Code erreur", et91.zones[i++].value);
670
- this.log("Signe montant accepté compte A", et91.zones[i++].value);
671
- const acceptedAmountAccount1 = this.log("montant accepté compte A", et91.zones[i++].value);
672
- this.log("Code erreur", et91.zones[i++].value);
673
- this.log("Signe montant refusé compte A", et91.zones[i++].value);
674
- const rejectedAmountAccount1 = this.log("montant refusé compte A", et91.zones[i++].value);
675
- this.log("Code erreur", et91.zones[i++].value);
676
- this.log("Signe montant accepté compte B", et91.zones[i++].value);
677
- const acceptedAmountAccount2 = this.log("Montant accepté compte B", et91.zones[i++].value);
678
- this.log("Code erreur", et91.zones[i++].value);
679
- this.log("Signe montant refusé compte B", et91.zones[i++].value);
680
- const rejectedAmountAccount2 = this.log("Montant refusé compte B", et91.zones[i++].value);
681
- this.log("Code erreur", et91.zones[i++].value);
682
- this.log("Signe total montants acceptés compte A + compte B", et91.zones[i++].value);
683
- const totalAcceptedAmount = this.log("Total montants acceptés compte A+compte B", et91.zones[i++].value);
684
- this.log("Code erreur", et91.zones[i++].value);
685
- this.log("Signe total montants refusés compte A + compte B", et91.zones[i++].value);
686
- const totalRejectedAmount = this.log("Total montants refusés compte A+compteB", et91.zones[i++].value);
687
- this.log("Code erreur", et91.zones[i++].value);
688
- const paymentReferenceAccount1 = this.log("Référence paiement compte A OA ou mutualité", et91.zones[i++].value);
689
- this.log("Code erreur", et91.zones[i++].value);
690
- const paymentReferenceAccount2 = this.log("Référence paiement compte B OA ou mutualité", et91.zones[i++].value);
691
- this.log("Code erreur", et91.zones[i++].value);
692
- this.log("Reserve", et91.zones[i++].value);
693
- if (i !== et91.zones.length) {
694
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
695
- }
696
- return {
697
- askedAmountForAccount1,
698
- askedAmountForAccount2,
699
- totalAskedAmount,
700
- numberOfRecordBundle,
701
- acceptedAmountAccount1,
702
- rejectedAmountAccount1,
703
- acceptedAmountAccount2,
704
- rejectedAmountAccount2,
705
- totalAcceptedAmount,
706
- totalRejectedAmount,
707
- paymentReferenceAccount1,
708
- paymentReferenceAccount2
709
- };
710
- }
711
- readET92(et92) {
712
- const etNumber = 92;
713
- let i = 0;
714
- if (et92.zones[i].value !== etNumber.toString()) {
715
- throw new Error(`Trying to parse an ET${etNumber} that is not an ET${etNumber} --- ${JSON.stringify(et92)}`);
716
- }
717
- this.log("Type", et92.zones[i++].value);
718
- this.log("Code erreur", et92.zones[i++].value);
719
- this.log("Lien T10 N mutualit", et92.zones[i++].value);
720
- this.log("Code erreur", et92.zones[i++].value);
721
- this.log("n facture recapitulative", et92.zones[i++].value);
722
- this.log("Code erreur", et92.zones[i++].value);
723
- this.log("Signe montant demand compte A", et92.zones[i++].value);
724
- const askedAmountAccount1 = this.log("Montant demand compte A", et92.zones[i++].value);
725
- this.log("Code erreur", et92.zones[i++].value);
726
- this.log("Signe montant demand compte B", et92.zones[i++].value);
727
- const askedAmountAccount2 = this.log("Montant demand compte B", et92.zones[i++].value);
728
- this.log("Code erreur", et92.zones[i++].value);
729
- this.log("Signe Montant demand A + B", et92.zones[i++].value);
730
- const totalAskedAmount = this.log("Montant demand compte A + B = lien Cpt A", et92.zones[i++].value);
731
- this.log("Code erreur", et92.zones[i++].value);
732
- const numberOfRecord = this.log("Nombre d'enregistrement", et92.zones[i++].value);
733
- this.log("Code erreur", et92.zones[i++].value);
734
- this.log("Lien T80 Z98 N contrle par mutuelle", et92.zones[i++].value);
735
- this.log("Code erreur", et92.zones[i++].value);
736
- this.log("Signe montant accepté compte A", et92.zones[i++].value);
737
- const acceptedAmountAccount1 = this.log("montant accepté compte A", et92.zones[i++].value);
738
- this.log("Code erreur", et92.zones[i++].value);
739
- this.log("Signe montant refusé compte A", et92.zones[i++].value);
740
- const rejectedAmountAccount1 = this.log("montant refusé compte A", et92.zones[i++].value);
741
- this.log("Code erreur", et92.zones[i++].value);
742
- this.log("Signe montant accepté compte B", et92.zones[i++].value);
743
- const acceptedAmountAccount2 = this.log("Montant accepté compte B", et92.zones[i++].value);
744
- this.log("Code erreur", et92.zones[i++].value);
745
- this.log("Signe montant refusé compte B", et92.zones[i++].value);
746
- const rejectedAmountAccount2 = this.log("Montant refusé compte B", et92.zones[i++].value);
747
- this.log("Code erreur", et92.zones[i++].value);
748
- this.log("Signe total montants acceptés compte A + compte B", et92.zones[i++].value);
749
- const totalAcceptedAmount = this.log("Total montants acceptés compte A+compte B", et92.zones[i++].value);
750
- this.log("Code erreur", et92.zones[i++].value);
751
- this.log("Signe total montants refusés compte A + compte B", et92.zones[i++].value);
752
- const totalRejectedAmount = this.log("Total montants refusés compte A+compteB", et92.zones[i++].value);
753
- this.log("Code erreur", et92.zones[i++].value);
754
- this.log("Réserve", et92.zones[i++].value);
755
- if (i !== et92.zones.length) {
756
- throw new Error(`You didn\'t parse every zones of the ET${etNumber}`);
757
- }
758
- return {
759
- askedAmountAccount1,
760
- askedAmountAccount2,
761
- totalAskedAmount,
762
- numberOfRecord,
763
- acceptedAmountAccount1,
764
- rejectedAmountAccount1,
765
- acceptedAmountAccount2,
766
- rejectedAmountAccount2,
767
- totalAcceptedAmount,
768
- totalRejectedAmount
769
- };
770
- }
771
- readZone400(zone400) {
772
- let i = 0;
773
- this.log("Type", zone400.zones[i++].value);
774
- this.log("Code d'erreur", zone400.zones[i++].value);
775
- this.log("numero de mutuelle", zone400.zones[i++].value);
776
- const mutuelle = zone400.zones[i - 1].value;
777
- this.log("code d'erreur", zone400.zones[i++].value);
778
- this.log("numero de la facture recapitulative", zone400.zones[i++].value);
779
- this.log("code d'erreur", zone400.zones[i++].value);
780
- this.log("signe montant demande compte A", zone400.zones[i++].value);
781
- const signMontantA = zone400.zones[i - 1].value;
782
- this.log("montant demande compte A", zone400.zones[i++].value);
783
- const montantDemandeA = zone400.zones[i - 1].value;
784
- this.log("code d'erreur", zone400.zones[i++].value);
785
- this.log("signe montant demande compte B", zone400.zones[i++].value);
786
- this.log("montant demande compte B", zone400.zones[i++].value);
787
- this.log("code d'erreur", zone400.zones[i++].value);
788
- this.log("signe somme A + B", zone400.zones[i++].value);
789
- this.log("total somme A + B", zone400.zones[i++].value);
790
- this.log("code d'erreur", zone400.zones[i++].value);
791
- this.log("nombre d'enregistrements", zone400.zones[i++].value);
792
- this.log("code d'erreur", zone400.zones[i++].value);
793
- this.log("numero de controle par mutualite", zone400.zones[i++].value);
794
- const controleMut = zone400.zones[i - 1].value;
795
- this.log("code d'erreur", zone400.zones[i++].value);
796
- this.log("reserve", zone400.zones[i++].value);
797
- if (zone400.zones.length !== i) {
798
- throw Error("Zone 400: The parsing is not matching the available number of zones.");
799
- }
800
- return {
801
- mutualityNumber: mutuelle,
802
- signAmount1: signMontantA,
803
- askedAmount1: montantDemandeA,
804
- mutualityControlNumber: controleMut
805
- };
806
- }
807
- readZone500(zone500) {
808
- let i = 0;
809
- this.log("Type", zone500.zones[i++].value);
810
- this.log("Code d'erreur", zone500.zones[i++].value);
811
- this.log("numero de mutuelle", zone500.zones[i++].value);
812
- const mutuelle = zone500.zones[i - 1].value;
813
- this.log("code d'erreur", zone500.zones[i++].value);
814
- this.log("non utlise", zone500.zones[i++].value);
815
- this.log("code d'erreur", zone500.zones[i++].value);
816
- this.log("numero de la facture recapitulative", zone500.zones[i++].value);
817
- this.log("code d'erreur", zone500.zones[i++].value);
818
- this.log("signe montant demande compte A", zone500.zones[i++].value);
819
- const signMontantA = zone500.zones[i - 1].value;
820
- this.log("montant demande compte A", zone500.zones[i++].value);
821
- const montantDemandeA = zone500.zones[i - 1].value;
822
- this.log("code d'erreur", zone500.zones[i++].value);
823
- this.log("signe montant demande compte B", zone500.zones[i++].value);
824
- this.log("montant demande compte B", zone500.zones[i++].value);
825
- this.log("code d'erreur", zone500.zones[i++].value);
826
- this.log("signe somme A + B", zone500.zones[i++].value);
827
- this.log("total somme A + B", zone500.zones[i++].value);
828
- this.log("code d'erreur", zone500.zones[i++].value);
829
- this.log("nombre d'enregistrements", zone500.zones[i++].value);
830
- this.log("code d'erreur", zone500.zones[i++].value);
831
- this.log("numero de controle par mutualite", zone500.zones[i++].value);
832
- const controleMut = zone500.zones[i - 1].value;
833
- this.log("code d'erreur", zone500.zones[i++].value);
834
- this.log("reserve", zone500.zones[i++].value);
835
- if (zone500.zones.length !== i) {
836
- throw Error("Zone 500: The parsing is not matching the available number of zones.");
837
- }
838
- return {
839
- mutualityNumber: mutuelle,
840
- signAmount1: signMontantA,
841
- askedAmount1: montantDemandeA,
842
- mutualityControlNumber: controleMut
843
- };
844
- }
845
- }
846
- exports.EfactMessageReader = EfactMessageReader;
847
- class EfactMessage920900Reader extends EfactMessageReader {
848
- constructor() {
849
- super(...arguments);
850
- this.fileType = "920900";
851
- }
852
- read() {
853
- try {
854
- let i = 0;
855
- // FIXME the code does not support multiple invoices yet.
856
- const rawRecords = this.message.message;
857
- const zone200 = this.readZone200(rawRecords[i]);
858
- i++;
859
- const zone300 = this.readZone300(rawRecords[i]);
860
- i++;
861
- const et10 = this.readET10(rawRecords[i]);
862
- i++;
863
- const records = [];
864
- while (rawRecords[i].zones[0].value === "20") {
865
- const et20 = this.readET20(rawRecords[i]);
866
- i++;
867
- const items = [];
868
- while (rawRecords[i].zones[0].value === "50" ||
869
- rawRecords[i].zones[0].value === "51" ||
870
- rawRecords[i].zones[0].value === "52") {
871
- let et50;
872
- let et51;
873
- let et52;
874
- if (rawRecords[i].zones[0].value === "50") {
875
- et50 = this.readET50(rawRecords[i]);
876
- i++;
877
- }
878
- if (rawRecords[i].zones[0].value === "51") {
879
- et51 = this.readET51(rawRecords[i]);
880
- i++;
881
- }
882
- if (rawRecords[i].zones[0].value === "52") {
883
- et52 = this.readET52(rawRecords[i]);
884
- i++;
885
- }
886
- items.push({
887
- et50,
888
- et51,
889
- et52
890
- });
891
- }
892
- const et80 = this.readET80(rawRecords[i]);
893
- i++;
894
- records.push({
895
- et20,
896
- items,
897
- et80
898
- });
899
- }
900
- const et90 = this.readET90(rawRecords[i]);
901
- i++;
902
- const et91s = [];
903
- while (rawRecords[i].zones[0].value === "91") {
904
- et91s.push(this.readET91(rawRecords[i]));
905
- i++;
906
- }
907
- const et92 = this.readET92(rawRecords[i]);
908
- i++;
909
- if (rawRecords.length !== i) {
910
- throw new Error("EfactMessage was not entirely parsed " + JSON.stringify(this.message));
911
- }
912
- return {
913
- zone200,
914
- zone300,
915
- et10,
916
- records,
917
- et90,
918
- et91: et91s,
919
- et92
920
- };
921
- }
922
- catch (err) {
923
- console.error(err, "Cannot parse message", this.message);
924
- }
925
- }
926
- }
927
- exports.EfactMessage920900Reader = EfactMessage920900Reader;
928
- class EfactMessage931000Reader extends EfactMessageReader {
929
- constructor() {
930
- super(...arguments);
931
- this.fileType = "931000";
932
- }
933
- read() {
934
- const zone200 = this.readZone200(this.message.message[0]);
935
- return {
936
- zone200
937
- };
938
- }
939
- }
940
- exports.EfactMessage931000Reader = EfactMessage931000Reader;
941
- class EfactMessage920099Reader extends EfactMessageReader {
942
- constructor() {
943
- super(...arguments);
944
- this.fileType = "920099";
945
- }
946
- read() {
947
- try {
948
- let i = 0;
949
- // FIXME the code does not support multiple invoices yet.
950
- const rawRecords = this.message.message;
951
- const zone200 = this.readZone200(rawRecords[i]);
952
- i++;
953
- const zone300 = this.readZone300(rawRecords[i]);
954
- i++;
955
- const et10 = this.readET10(rawRecords[i]);
956
- i++;
957
- const records = [];
958
- while (rawRecords[i].zones[0].value === "20") {
959
- const et20 = this.readET20(rawRecords[i]);
960
- i++;
961
- const items = [];
962
- while (rawRecords[i].zones[0].value === "50" ||
963
- rawRecords[i].zones[0].value === "51" ||
964
- rawRecords[i].zones[0].value === "52") {
965
- let et50;
966
- let et51;
967
- let et52;
968
- if (rawRecords[i].zones[0].value === "50") {
969
- et50 = this.readET50(rawRecords[i]);
970
- i++;
971
- }
972
- if (rawRecords[i].zones[0].value === "51") {
973
- et51 = this.readET51(rawRecords[i]);
974
- i++;
975
- }
976
- if (rawRecords[i].zones[0].value === "52") {
977
- et52 = this.readET52(rawRecords[i]);
978
- i++;
979
- }
980
- items.push({
981
- et50,
982
- et51,
983
- et52
984
- });
985
- }
986
- const et80 = this.readET80(rawRecords[i]);
987
- i++;
988
- records.push({
989
- et20,
990
- items,
991
- et80
992
- });
993
- }
994
- const et90 = this.readET90(rawRecords[i]);
995
- i++;
996
- if (rawRecords.length !== i) {
997
- throw new Error("EfactMessage was not entirely parsed " + JSON.stringify(this.message));
998
- }
999
- return {
1000
- zone200,
1001
- zone300,
1002
- et10,
1003
- records,
1004
- et90
1005
- };
1006
- }
1007
- catch (err) {
1008
- console.error(err, "Cannot parse message", this.message);
1009
- }
1010
- }
1011
- }
1012
- exports.EfactMessage920099Reader = EfactMessage920099Reader;
1013
- class EfactMessage920098Reader extends EfactMessageReader {
1014
- constructor() {
1015
- super(...arguments);
1016
- this.fileType = "920098";
1017
- }
1018
- read() {
1019
- try {
1020
- let i = 0;
1021
- // FIXME the code does not support multiple invoices yet.
1022
- const rawRecords = this.message.message;
1023
- const zone200 = this.readZone200(rawRecords[i]);
1024
- i++;
1025
- const zone300 = this.readZone300(rawRecords[i]);
1026
- i++;
1027
- const et10 = this.readET10(rawRecords[i]);
1028
- i++;
1029
- const records = [];
1030
- while (rawRecords[i].zones[0].value === "20") {
1031
- const et20 = this.readET20(rawRecords[i]);
1032
- i++;
1033
- const items = [];
1034
- while (rawRecords[i].zones[0].value === "50" ||
1035
- rawRecords[i].zones[0].value === "51" ||
1036
- rawRecords[i].zones[0].value === "52") {
1037
- let et50;
1038
- let et51;
1039
- let et52;
1040
- if (rawRecords[i].zones[0].value === "50") {
1041
- et50 = this.readET50(rawRecords[i]);
1042
- i++;
1043
- }
1044
- if (rawRecords[i].zones[0].value === "51") {
1045
- et51 = this.readET51(rawRecords[i]);
1046
- i++;
1047
- }
1048
- if (rawRecords[i].zones[0].value === "52") {
1049
- et52 = this.readET52(rawRecords[i]);
1050
- i++;
1051
- }
1052
- items.push({
1053
- et50,
1054
- et51,
1055
- et52
1056
- });
1057
- }
1058
- const et80 = this.readET80(rawRecords[i]);
1059
- i++;
1060
- records.push({
1061
- et20,
1062
- items,
1063
- et80
1064
- });
1065
- }
1066
- const et90 = this.readET90(rawRecords[i]);
1067
- i++;
1068
- if (rawRecords.length !== i) {
1069
- throw new Error("EfactMessage was not entirely parsed " + JSON.stringify(this.message));
1070
- }
1071
- return {
1072
- zone200,
1073
- zone300,
1074
- et10,
1075
- records,
1076
- et90
1077
- };
1078
- }
1079
- catch (err) {
1080
- console.error(err, "Cannot parse message", this.message);
1081
- }
1082
- }
1083
- }
1084
- exports.EfactMessage920098Reader = EfactMessage920098Reader;
1085
- class EfactMessage920999Reader extends EfactMessageReader {
1086
- constructor() {
1087
- super(...arguments);
1088
- this.fileType = "920999";
1089
- }
1090
- read() {
1091
- try {
1092
- let i = 0;
1093
- // FIXME the code does not support multiple invoices yet.
1094
- let rawRecords = this.message.message;
1095
- const zone200 = this.readZone200(rawRecords[i++]);
1096
- const zone300 = this.readZone300Short(rawRecords[i++]);
1097
- let et95 = [];
1098
- while (rawRecords[i] && rawRecords[i].zones[0].value === "95") {
1099
- const zone400 = this.readZone400(rawRecords[i++]);
1100
- et95.push(zone400);
1101
- }
1102
- let et96;
1103
- if (rawRecords[i] && rawRecords[i].zones[0].value === "96") {
1104
- et96 = this.readZone500(rawRecords[i++]);
1105
- }
1106
- if (rawRecords.length !== i) {
1107
- throw new Error("EfactMessage was not entirely parsed " + JSON.stringify(this.message));
1108
- }
1109
- return {
1110
- zone200,
1111
- zone300,
1112
- et95,
1113
- et96
1114
- };
1115
- }
1116
- catch (err) {
1117
- console.error(err, "Cannot parse message", this.message);
1118
- }
1119
- }
1120
- }
1121
- exports.EfactMessage920999Reader = EfactMessage920999Reader;