@f1studio/form-spec 5.0.0-alpha.123 → 5.0.0-alpha.125

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 (46) hide show
  1. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts.map +1 -1
  2. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts +8 -51
  3. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts.map +1 -1
  4. package/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.d.ts +73 -0
  5. package/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.d.ts.map +1 -0
  6. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +162 -0
  7. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -0
  8. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +46 -0
  9. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  10. package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js +1 -1
  11. package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js.map +1 -1
  12. package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.ts.map +1 -1
  13. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js +1 -1
  14. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js.map +1 -1
  15. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts.map +1 -1
  16. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js +16 -220
  17. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js.map +1 -1
  18. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts.map +1 -1
  19. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
  20. package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
  21. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.js +387 -0
  22. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.js.map +1 -0
  23. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.ts.map +1 -0
  24. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +771 -0
  25. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -0
  26. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +1 -0
  27. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +151 -0
  28. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  29. package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
  30. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
  31. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
  32. package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
  33. package/README.md +7 -7
  34. package/package.json +1 -1
  35. package/src/FormSpec.FS/BitmaskHelpers.ts +1 -1
  36. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts +2 -2
  37. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts +32 -127
  38. package/src/FormSpec.FS/Integrations/CorEMR/TemplateDecodeTypes.ts +246 -0
  39. package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +431 -0
  40. package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +184 -3
  41. package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts +0 -95
  42. package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts.map +0 -1
  43. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js +0 -258
  44. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js.map +0 -1
  45. package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts.map +0 -1
  46. package/src/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts +0 -15
@@ -0,0 +1,771 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get CodeExtractionStats () {
13
+ return CodeExtractionStats;
14
+ },
15
+ get CodeExtractionStats_$reflection () {
16
+ return CodeExtractionStats_$reflection;
17
+ },
18
+ get CoreEmrInfo () {
19
+ return CoreEmrInfo;
20
+ },
21
+ get CoreEmrInfo_$reflection () {
22
+ return CoreEmrInfo_$reflection;
23
+ },
24
+ get ElementTypeEntry () {
25
+ return ElementTypeEntry;
26
+ },
27
+ get ElementTypeEntry_$reflection () {
28
+ return ElementTypeEntry_$reflection;
29
+ },
30
+ get EncounterTypes () {
31
+ return EncounterTypes;
32
+ },
33
+ get EncounterTypes_$reflection () {
34
+ return EncounterTypes_$reflection;
35
+ },
36
+ get FormScoring () {
37
+ return FormScoring;
38
+ },
39
+ get FormScoring_$reflection () {
40
+ return FormScoring_$reflection;
41
+ },
42
+ get InstrumentMapEntry () {
43
+ return InstrumentMapEntry;
44
+ },
45
+ get InstrumentMapEntry_$reflection () {
46
+ return InstrumentMapEntry_$reflection;
47
+ },
48
+ get InstrumentMapStats () {
49
+ return InstrumentMapStats;
50
+ },
51
+ get InstrumentMapStats_$reflection () {
52
+ return InstrumentMapStats_$reflection;
53
+ },
54
+ get ScoringLabel () {
55
+ return ScoringLabel;
56
+ },
57
+ get ScoringLabel_$reflection () {
58
+ return ScoringLabel_$reflection;
59
+ },
60
+ get TemplateChoice () {
61
+ return TemplateChoice;
62
+ },
63
+ get TemplateChoice_$reflection () {
64
+ return TemplateChoice_$reflection;
65
+ },
66
+ get TemplateForm () {
67
+ return TemplateForm;
68
+ },
69
+ get TemplateForm_$reflection () {
70
+ return TemplateForm_$reflection;
71
+ },
72
+ get TemplateItem () {
73
+ return TemplateItem;
74
+ },
75
+ get TemplateItem_$reflection () {
76
+ return TemplateItem_$reflection;
77
+ },
78
+ get TemplateManifest () {
79
+ return TemplateManifest;
80
+ },
81
+ get TemplateManifest_$reflection () {
82
+ return TemplateManifest_$reflection;
83
+ },
84
+ get TemplateStats () {
85
+ return TemplateStats;
86
+ },
87
+ get TemplateStats_$reflection () {
88
+ return TemplateStats_$reflection;
89
+ },
90
+ get decodeManifest () {
91
+ return decodeManifest;
92
+ },
93
+ get decodeTemplateForm () {
94
+ return decodeTemplateForm;
95
+ },
96
+ get templateFormDecoder () {
97
+ return templateFormDecoder;
98
+ },
99
+ get toCoreMRFormData () {
100
+ return toCoreMRFormData;
101
+ }
102
+ });
103
+ const _Types = require("@fable-org/fable-library-js/Types.js");
104
+ const _BigInt = require("@fable-org/fable-library-js/BigInt.js");
105
+ const _Option = require("@fable-org/fable-library-js/Option.js");
106
+ const _Util = require("@fable-org/fable-library-js/Util.js");
107
+ const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
108
+ const _List = require("@fable-org/fable-library-js/List.js");
109
+ const _Map = require("@fable-org/fable-library-js/Map.js");
110
+ const _Guid = require("@fable-org/fable-library-js/Guid.js");
111
+ const _Encodefs = require("../../../fable_modules/Thoth.Json.10.4.1/Encode.fs.js");
112
+ const _Decodefs = require("../../../fable_modules/Thoth.Json.10.4.1/Decode.fs.js");
113
+ const _Typesfs = require("../../../fable_modules/Thoth.Json.10.4.1/Types.fs.js");
114
+ const _Extrafs = require("../../../fable_modules/Thoth.Json.10.4.1/Extra.fs.js");
115
+ const _CoreMRTypes = require("./CoreMRTypes.js");
116
+ const _String = require("@fable-org/fable-library-js/String.js");
117
+ class TemplateChoice extends _Types.Record {
118
+ constructor(ChoiceId, Sequence, Score, Text$, BitPosition, Code, Highlight){
119
+ super();
120
+ this.ChoiceId = ChoiceId | 0;
121
+ this.Sequence = Sequence | 0;
122
+ this.Score = Score;
123
+ this.Text = Text$;
124
+ this.BitPosition = BitPosition;
125
+ this.Code = Code;
126
+ this.Highlight = Highlight;
127
+ }
128
+ }
129
+ function TemplateChoice_$reflection() {
130
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.TemplateChoice", [], TemplateChoice, ()=>[
131
+ [
132
+ "ChoiceId",
133
+ _Reflection.int32_type
134
+ ],
135
+ [
136
+ "Sequence",
137
+ _Reflection.int32_type
138
+ ],
139
+ [
140
+ "Score",
141
+ _Reflection.int64_type
142
+ ],
143
+ [
144
+ "Text",
145
+ _Reflection.string_type
146
+ ],
147
+ [
148
+ "BitPosition",
149
+ (0, _Reflection.option_type)(_Reflection.int32_type)
150
+ ],
151
+ [
152
+ "Code",
153
+ (0, _Reflection.option_type)(_Reflection.string_type)
154
+ ],
155
+ [
156
+ "Highlight",
157
+ (0, _Reflection.option_type)(_Reflection.int32_type)
158
+ ]
159
+ ]);
160
+ }
161
+ class TemplateItem extends _Types.Record {
162
+ constructor(ItemId, Sequence, Type, NestingLevel, IsRequired, Text$, SequenceText, Code, Uuid, GenderRequired, Highlight, Choices){
163
+ super();
164
+ this.ItemId = ItemId | 0;
165
+ this.Sequence = Sequence | 0;
166
+ this.Type = Type | 0;
167
+ this.NestingLevel = NestingLevel | 0;
168
+ this.IsRequired = IsRequired;
169
+ this.Text = Text$;
170
+ this.SequenceText = SequenceText;
171
+ this.Code = Code;
172
+ this.Uuid = Uuid;
173
+ this.GenderRequired = GenderRequired;
174
+ this.Highlight = Highlight;
175
+ this.Choices = Choices;
176
+ }
177
+ }
178
+ function TemplateItem_$reflection() {
179
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.TemplateItem", [], TemplateItem, ()=>[
180
+ [
181
+ "ItemId",
182
+ _Reflection.int32_type
183
+ ],
184
+ [
185
+ "Sequence",
186
+ _Reflection.int32_type
187
+ ],
188
+ [
189
+ "Type",
190
+ _Reflection.int32_type
191
+ ],
192
+ [
193
+ "NestingLevel",
194
+ _Reflection.int32_type
195
+ ],
196
+ [
197
+ "IsRequired",
198
+ _Reflection.bool_type
199
+ ],
200
+ [
201
+ "Text",
202
+ _Reflection.string_type
203
+ ],
204
+ [
205
+ "SequenceText",
206
+ (0, _Reflection.option_type)(_Reflection.string_type)
207
+ ],
208
+ [
209
+ "Code",
210
+ (0, _Reflection.option_type)(_Reflection.string_type)
211
+ ],
212
+ [
213
+ "Uuid",
214
+ (0, _Reflection.option_type)(_Reflection.string_type)
215
+ ],
216
+ [
217
+ "GenderRequired",
218
+ (0, _Reflection.option_type)(_Reflection.string_type)
219
+ ],
220
+ [
221
+ "Highlight",
222
+ (0, _Reflection.option_type)(_Reflection.int32_type)
223
+ ],
224
+ [
225
+ "Choices",
226
+ (0, _Reflection.list_type)(TemplateChoice_$reflection())
227
+ ]
228
+ ]);
229
+ }
230
+ class EncounterTypes extends _Types.Record {
231
+ constructor(Medical, Mental, Dental, Other){
232
+ super();
233
+ this.Medical = Medical;
234
+ this.Mental = Mental;
235
+ this.Dental = Dental;
236
+ this.Other = Other;
237
+ }
238
+ }
239
+ function EncounterTypes_$reflection() {
240
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.EncounterTypes", [], EncounterTypes, ()=>[
241
+ [
242
+ "Medical",
243
+ _Reflection.bool_type
244
+ ],
245
+ [
246
+ "Mental",
247
+ _Reflection.bool_type
248
+ ],
249
+ [
250
+ "Dental",
251
+ _Reflection.bool_type
252
+ ],
253
+ [
254
+ "Other",
255
+ _Reflection.bool_type
256
+ ]
257
+ ]);
258
+ }
259
+ class ScoringLabel extends _Types.Record {
260
+ constructor(Name, Min){
261
+ super();
262
+ this.Name = Name;
263
+ this.Min = Min | 0;
264
+ }
265
+ }
266
+ function ScoringLabel_$reflection() {
267
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.ScoringLabel", [], ScoringLabel, ()=>[
268
+ [
269
+ "Name",
270
+ _Reflection.string_type
271
+ ],
272
+ [
273
+ "Min",
274
+ _Reflection.int32_type
275
+ ]
276
+ ]);
277
+ }
278
+ class FormScoring extends _Types.Record {
279
+ constructor(ScoreId, ScoreName, Labels, ChoiceScores){
280
+ super();
281
+ this.ScoreId = ScoreId | 0;
282
+ this.ScoreName = ScoreName;
283
+ this.Labels = Labels;
284
+ this.ChoiceScores = ChoiceScores;
285
+ }
286
+ }
287
+ function FormScoring_$reflection() {
288
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.FormScoring", [], FormScoring, ()=>[
289
+ [
290
+ "ScoreId",
291
+ _Reflection.int32_type
292
+ ],
293
+ [
294
+ "ScoreName",
295
+ _Reflection.string_type
296
+ ],
297
+ [
298
+ "Labels",
299
+ (0, _Reflection.list_type)(ScoringLabel_$reflection())
300
+ ],
301
+ [
302
+ "ChoiceScores",
303
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
304
+ _Reflection.string_type,
305
+ _Reflection.int32_type
306
+ ])
307
+ ]
308
+ ]);
309
+ }
310
+ class TemplateForm extends _Types.Record {
311
+ constructor(FormId, Name, FormCode, FormCodeSource, Description, CurrentVersionId, IsIntake, Usage, RequiresSignature, EncounterTypes, OnceAYear, StructureHash, ClinicalHash, CosmeticHash, Hash, Items, Scoring){
312
+ super();
313
+ this.FormId = FormId | 0;
314
+ this.Name = Name;
315
+ this.FormCode = FormCode;
316
+ this.FormCodeSource = FormCodeSource;
317
+ this.Description = Description;
318
+ this.CurrentVersionId = CurrentVersionId;
319
+ this.IsIntake = IsIntake;
320
+ this.Usage = Usage;
321
+ this.RequiresSignature = RequiresSignature;
322
+ this.EncounterTypes = EncounterTypes;
323
+ this.OnceAYear = OnceAYear;
324
+ this.StructureHash = StructureHash;
325
+ this.ClinicalHash = ClinicalHash;
326
+ this.CosmeticHash = CosmeticHash;
327
+ this.Hash = Hash;
328
+ this.Items = Items;
329
+ this.Scoring = Scoring;
330
+ }
331
+ }
332
+ function TemplateForm_$reflection() {
333
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.TemplateForm", [], TemplateForm, ()=>[
334
+ [
335
+ "FormId",
336
+ _Reflection.int32_type
337
+ ],
338
+ [
339
+ "Name",
340
+ _Reflection.string_type
341
+ ],
342
+ [
343
+ "FormCode",
344
+ _Reflection.string_type
345
+ ],
346
+ [
347
+ "FormCodeSource",
348
+ _Reflection.string_type
349
+ ],
350
+ [
351
+ "Description",
352
+ _Reflection.string_type
353
+ ],
354
+ [
355
+ "CurrentVersionId",
356
+ _Reflection.int64_type
357
+ ],
358
+ [
359
+ "IsIntake",
360
+ _Reflection.bool_type
361
+ ],
362
+ [
363
+ "Usage",
364
+ _Reflection.string_type
365
+ ],
366
+ [
367
+ "RequiresSignature",
368
+ _Reflection.bool_type
369
+ ],
370
+ [
371
+ "EncounterTypes",
372
+ EncounterTypes_$reflection()
373
+ ],
374
+ [
375
+ "OnceAYear",
376
+ _Reflection.bool_type
377
+ ],
378
+ [
379
+ "StructureHash",
380
+ _Reflection.string_type
381
+ ],
382
+ [
383
+ "ClinicalHash",
384
+ _Reflection.string_type
385
+ ],
386
+ [
387
+ "CosmeticHash",
388
+ _Reflection.string_type
389
+ ],
390
+ [
391
+ "Hash",
392
+ _Reflection.string_type
393
+ ],
394
+ [
395
+ "Items",
396
+ (0, _Reflection.list_type)(TemplateItem_$reflection())
397
+ ],
398
+ [
399
+ "Scoring",
400
+ (0, _Reflection.option_type)(FormScoring_$reflection())
401
+ ]
402
+ ]);
403
+ }
404
+ class ElementTypeEntry extends _Types.Record {
405
+ constructor(Code, ValueEncoding, TextField){
406
+ super();
407
+ this.Code = Code;
408
+ this.ValueEncoding = ValueEncoding;
409
+ this.TextField = TextField;
410
+ }
411
+ }
412
+ function ElementTypeEntry_$reflection() {
413
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.ElementTypeEntry", [], ElementTypeEntry, ()=>[
414
+ [
415
+ "Code",
416
+ _Reflection.string_type
417
+ ],
418
+ [
419
+ "ValueEncoding",
420
+ _Reflection.string_type
421
+ ],
422
+ [
423
+ "TextField",
424
+ _Reflection.string_type
425
+ ]
426
+ ]);
427
+ }
428
+ class InstrumentMapEntry extends _Types.Record {
429
+ constructor(InstrumentType, FormCode, MaxScore, Source, Archived, FormName){
430
+ super();
431
+ this.InstrumentType = InstrumentType;
432
+ this.FormCode = FormCode;
433
+ this.MaxScore = MaxScore;
434
+ this.Source = Source;
435
+ this.Archived = Archived;
436
+ this.FormName = FormName;
437
+ }
438
+ }
439
+ function InstrumentMapEntry_$reflection() {
440
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.InstrumentMapEntry", [], InstrumentMapEntry, ()=>[
441
+ [
442
+ "InstrumentType",
443
+ _Reflection.string_type
444
+ ],
445
+ [
446
+ "FormCode",
447
+ _Reflection.string_type
448
+ ],
449
+ [
450
+ "MaxScore",
451
+ (0, _Reflection.option_type)(_Reflection.int32_type)
452
+ ],
453
+ [
454
+ "Source",
455
+ _Reflection.string_type
456
+ ],
457
+ [
458
+ "Archived",
459
+ _Reflection.bool_type
460
+ ],
461
+ [
462
+ "FormName",
463
+ _Reflection.string_type
464
+ ]
465
+ ]);
466
+ }
467
+ class CodeExtractionStats extends _Types.Record {
468
+ constructor(Extracted, Generated, BySource, Regex){
469
+ super();
470
+ this.Extracted = Extracted | 0;
471
+ this.Generated = Generated | 0;
472
+ this.BySource = BySource;
473
+ this.Regex = Regex;
474
+ }
475
+ }
476
+ function CodeExtractionStats_$reflection() {
477
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.CodeExtractionStats", [], CodeExtractionStats, ()=>[
478
+ [
479
+ "Extracted",
480
+ _Reflection.int32_type
481
+ ],
482
+ [
483
+ "Generated",
484
+ _Reflection.int32_type
485
+ ],
486
+ [
487
+ "BySource",
488
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
489
+ _Reflection.string_type,
490
+ _Reflection.int32_type
491
+ ])
492
+ ],
493
+ [
494
+ "Regex",
495
+ _Reflection.string_type
496
+ ]
497
+ ]);
498
+ }
499
+ class TemplateStats extends _Types.Record {
500
+ constructor(TotalForms, WithCodes, WithSyntheticCodes, WithScoring, WithSignature, ByUsage, ByElementType, CodeExtraction){
501
+ super();
502
+ this.TotalForms = TotalForms | 0;
503
+ this.WithCodes = WithCodes | 0;
504
+ this.WithSyntheticCodes = WithSyntheticCodes | 0;
505
+ this.WithScoring = WithScoring | 0;
506
+ this.WithSignature = WithSignature | 0;
507
+ this.ByUsage = ByUsage;
508
+ this.ByElementType = ByElementType;
509
+ this.CodeExtraction = CodeExtraction;
510
+ }
511
+ }
512
+ function TemplateStats_$reflection() {
513
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.TemplateStats", [], TemplateStats, ()=>[
514
+ [
515
+ "TotalForms",
516
+ _Reflection.int32_type
517
+ ],
518
+ [
519
+ "WithCodes",
520
+ _Reflection.int32_type
521
+ ],
522
+ [
523
+ "WithSyntheticCodes",
524
+ _Reflection.int32_type
525
+ ],
526
+ [
527
+ "WithScoring",
528
+ _Reflection.int32_type
529
+ ],
530
+ [
531
+ "WithSignature",
532
+ _Reflection.int32_type
533
+ ],
534
+ [
535
+ "ByUsage",
536
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
537
+ _Reflection.string_type,
538
+ _Reflection.int32_type
539
+ ])
540
+ ],
541
+ [
542
+ "ByElementType",
543
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
544
+ _Reflection.string_type,
545
+ _Reflection.int32_type
546
+ ])
547
+ ],
548
+ [
549
+ "CodeExtraction",
550
+ CodeExtractionStats_$reflection()
551
+ ]
552
+ ]);
553
+ }
554
+ class CoreEmrInfo extends _Types.Record {
555
+ constructor(AppVersion, SchemaVersion, SchemaRevision){
556
+ super();
557
+ this.AppVersion = AppVersion;
558
+ this.SchemaVersion = SchemaVersion;
559
+ this.SchemaRevision = SchemaRevision | 0;
560
+ }
561
+ }
562
+ function CoreEmrInfo_$reflection() {
563
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.CoreEmrInfo", [], CoreEmrInfo, ()=>[
564
+ [
565
+ "AppVersion",
566
+ _Reflection.string_type
567
+ ],
568
+ [
569
+ "SchemaVersion",
570
+ _Reflection.string_type
571
+ ],
572
+ [
573
+ "SchemaRevision",
574
+ _Reflection.int32_type
575
+ ]
576
+ ]);
577
+ }
578
+ class InstrumentMapStats extends _Types.Record {
579
+ constructor(Total, Current, Archived, BySource, ByType){
580
+ super();
581
+ this.Total = Total | 0;
582
+ this.Current = Current | 0;
583
+ this.Archived = Archived | 0;
584
+ this.BySource = BySource;
585
+ this.ByType = ByType;
586
+ }
587
+ }
588
+ function InstrumentMapStats_$reflection() {
589
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.InstrumentMapStats", [], InstrumentMapStats, ()=>[
590
+ [
591
+ "Total",
592
+ _Reflection.int32_type
593
+ ],
594
+ [
595
+ "Current",
596
+ _Reflection.int32_type
597
+ ],
598
+ [
599
+ "Archived",
600
+ _Reflection.int32_type
601
+ ],
602
+ [
603
+ "BySource",
604
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
605
+ _Reflection.string_type,
606
+ _Reflection.int32_type
607
+ ])
608
+ ],
609
+ [
610
+ "ByType",
611
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
612
+ _Reflection.string_type,
613
+ _Reflection.int32_type
614
+ ])
615
+ ]
616
+ ]);
617
+ }
618
+ class TemplateManifest extends _Types.Record {
619
+ constructor(Schema, Version, GeneratedAt, GeneratedFrom, CoreEmr, Stats, ElementTypes, Forms, InstrumentMap, InstrumentMapStats){
620
+ super();
621
+ this.Schema = Schema;
622
+ this.Version = Version | 0;
623
+ this.GeneratedAt = GeneratedAt;
624
+ this.GeneratedFrom = GeneratedFrom;
625
+ this.CoreEmr = CoreEmr;
626
+ this.Stats = Stats;
627
+ this.ElementTypes = ElementTypes;
628
+ this.Forms = Forms;
629
+ this.InstrumentMap = InstrumentMap;
630
+ this.InstrumentMapStats = InstrumentMapStats;
631
+ }
632
+ }
633
+ function TemplateManifest_$reflection() {
634
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.TemplateManifest", [], TemplateManifest, ()=>[
635
+ [
636
+ "Schema",
637
+ (0, _Reflection.option_type)(_Reflection.string_type)
638
+ ],
639
+ [
640
+ "Version",
641
+ _Reflection.int32_type
642
+ ],
643
+ [
644
+ "GeneratedAt",
645
+ _Reflection.string_type
646
+ ],
647
+ [
648
+ "GeneratedFrom",
649
+ _Reflection.string_type
650
+ ],
651
+ [
652
+ "CoreEmr",
653
+ CoreEmrInfo_$reflection()
654
+ ],
655
+ [
656
+ "Stats",
657
+ TemplateStats_$reflection()
658
+ ],
659
+ [
660
+ "ElementTypes",
661
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
662
+ _Reflection.string_type,
663
+ ElementTypeEntry_$reflection()
664
+ ])
665
+ ],
666
+ [
667
+ "Forms",
668
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
669
+ _Reflection.string_type,
670
+ TemplateForm_$reflection()
671
+ ])
672
+ ],
673
+ [
674
+ "InstrumentMap",
675
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
676
+ _Reflection.string_type,
677
+ InstrumentMapEntry_$reflection()
678
+ ])
679
+ ],
680
+ [
681
+ "InstrumentMapStats",
682
+ InstrumentMapStats_$reflection()
683
+ ]
684
+ ]);
685
+ }
686
+ const extraWithInt64 = new _Typesfs.ExtraCoders((()=>{
687
+ let copyOfStruct = (0, _Guid.newGuid)();
688
+ return copyOfStruct;
689
+ })(), (0, _Map.add)("System.Int64", [
690
+ _Encodefs.int64,
691
+ _Decodefs.int64
692
+ ], _Extrafs.empty.Coders));
693
+ const int64Decoder = (0, _Decodefs.Auto_generateBoxedDecoder_Z6670B51)(_Reflection.int64_type, undefined, extraWithInt64);
694
+ function dictDecoder(decoder) {
695
+ let d;
696
+ const decoder_1 = decoder;
697
+ d = (path)=>(value)=>(0, _Decodefs.keyValuePairs)(decoder_1, path, value);
698
+ return (path_1)=>(value_1)=>(0, _Decodefs.map)((elements)=>(0, _Map.ofList)(elements, {
699
+ Compare: _Util.comparePrimitives
700
+ }), (0, _Util.uncurry2)(d), path_1, value_1);
701
+ }
702
+ const choiceDecoder = (path_2)=>(v)=>(0, _Decodefs.object)((get$)=>{
703
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5;
704
+ return new TemplateChoice((objectArg = get$.Required, objectArg.Field("choiceId", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("sequence", (0, _Util.uncurry2)(_Decodefs.int))), 0n, (objectArg_2 = get$.Required, objectArg_2.Field("text", _Decodefs.string)), (objectArg_3 = get$.Optional, objectArg_3.Field("bitPosition", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_4 = get$.Optional, objectArg_4.Field("code", _Decodefs.string)), (objectArg_5 = get$.Optional, objectArg_5.Field("highlight", (0, _Util.uncurry2)(_Decodefs.int))));
705
+ }, path_2, v);
706
+ const itemDecoder = (path_7)=>(v)=>(0, _Decodefs.object)((get$)=>{
707
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, objectArg_9, objectArg_10, objectArg_11;
708
+ return new TemplateItem((objectArg = get$.Required, objectArg.Field("itemId", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("sequence", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_2 = get$.Required, objectArg_2.Field("type", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_3 = get$.Required, objectArg_3.Field("nestingLevel", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_4 = get$.Required, objectArg_4.Field("isRequired", _Decodefs.bool)), (objectArg_5 = get$.Required, objectArg_5.Field("text", _Decodefs.string)), (objectArg_6 = get$.Optional, objectArg_6.Field("sequenceText", _Decodefs.string)), (objectArg_7 = get$.Optional, objectArg_7.Field("code", _Decodefs.string)), (objectArg_8 = get$.Optional, objectArg_8.Field("uuid", _Decodefs.string)), (objectArg_9 = get$.Optional, objectArg_9.Field("genderRequired", _Decodefs.string)), (objectArg_10 = get$.Optional, objectArg_10.Field("highlight", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_11 = get$.Required, objectArg_11.Field("choices", (path_6, value_6)=>(0, _Decodefs.list)((0, _Util.uncurry2)(choiceDecoder), path_6, value_6))));
709
+ }, path_7, v);
710
+ const encounterTypesDecoder = (path_4)=>(v)=>(0, _Decodefs.object)((get$)=>{
711
+ let objectArg, objectArg_1, objectArg_2, objectArg_3;
712
+ return new EncounterTypes((objectArg = get$.Required, objectArg.Field("medical", _Decodefs.bool)), (objectArg_1 = get$.Required, objectArg_1.Field("mental", _Decodefs.bool)), (objectArg_2 = get$.Required, objectArg_2.Field("dental", _Decodefs.bool)), (objectArg_3 = get$.Required, objectArg_3.Field("other", _Decodefs.bool)));
713
+ }, path_4, v);
714
+ const scoringLabelDecoder = (path_1)=>(v)=>(0, _Decodefs.object)((get$)=>{
715
+ let objectArg, objectArg_1;
716
+ return new ScoringLabel((objectArg = get$.Required, objectArg.Field("name", _Decodefs.string)), (objectArg_1 = get$.Required, objectArg_1.Field("min", (0, _Util.uncurry2)(_Decodefs.int))));
717
+ }, path_1, v);
718
+ const formScoringDecoder = (path_2)=>(v)=>(0, _Decodefs.object)((get$)=>{
719
+ let objectArg, objectArg_1, objectArg_2, arg_7, objectArg_3;
720
+ return new FormScoring((objectArg = get$.Required, objectArg.Field("scoreId", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("scoreName", _Decodefs.string)), (objectArg_2 = get$.Required, objectArg_2.Field("labels", (path_1, value_1)=>(0, _Decodefs.list)((0, _Util.uncurry2)(scoringLabelDecoder), path_1, value_1))), (arg_7 = dictDecoder((0, _Util.uncurry2)(_Decodefs.int)), objectArg_3 = get$.Required, objectArg_3.Field("choiceScores", (0, _Util.uncurry2)(arg_7))));
721
+ }, path_2, v);
722
+ const formDecoder = (path_13)=>(v)=>(0, _Decodefs.object)((get$)=>{
723
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, objectArg_9, objectArg_10, objectArg_11, objectArg_12, objectArg_13, objectArg_14, objectArg_15, objectArg_16;
724
+ return new TemplateForm((objectArg = get$.Required, objectArg.Field("formId", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("name", _Decodefs.string)), (objectArg_2 = get$.Required, objectArg_2.Field("formCode", _Decodefs.string)), (objectArg_3 = get$.Required, objectArg_3.Field("formCodeSource", _Decodefs.string)), (objectArg_4 = get$.Required, objectArg_4.Field("description", _Decodefs.string)), (objectArg_5 = get$.Required, objectArg_5.Field("currentVersionId", (0, _Util.uncurry2)(int64Decoder))), (objectArg_6 = get$.Required, objectArg_6.Field("isIntake", _Decodefs.bool)), (objectArg_7 = get$.Required, objectArg_7.Field("usage", _Decodefs.string)), (objectArg_8 = get$.Required, objectArg_8.Field("requiresSignature", _Decodefs.bool)), (objectArg_9 = get$.Required, objectArg_9.Field("encounterTypes", (0, _Util.uncurry2)(encounterTypesDecoder))), (objectArg_10 = get$.Required, objectArg_10.Field("onceAYear", _Decodefs.bool)), (objectArg_11 = get$.Required, objectArg_11.Field("structureHash", _Decodefs.string)), (objectArg_12 = get$.Required, objectArg_12.Field("clinicalHash", _Decodefs.string)), (objectArg_13 = get$.Required, objectArg_13.Field("cosmeticHash", _Decodefs.string)), (objectArg_14 = get$.Required, objectArg_14.Field("hash", _Decodefs.string)), (objectArg_15 = get$.Required, objectArg_15.Field("items", (path_12, value_12)=>(0, _Decodefs.list)((0, _Util.uncurry2)(itemDecoder), path_12, value_12))), (objectArg_16 = get$.Optional, objectArg_16.Field("scoring", (0, _Util.uncurry2)(formScoringDecoder))));
725
+ }, path_13, v);
726
+ const elementTypeDecoder = (path_3)=>(v)=>(0, _Decodefs.object)((get$)=>{
727
+ let objectArg, objectArg_1, objectArg_2;
728
+ return new ElementTypeEntry((objectArg = get$.Required, objectArg.Field("code", _Decodefs.string)), (objectArg_1 = get$.Required, objectArg_1.Field("valueEncoding", _Decodefs.string)), (objectArg_2 = get$.Required, objectArg_2.Field("textField", _Decodefs.string)));
729
+ }, path_3, v);
730
+ const instrumentMapEntryDecoder = (path_5)=>(v)=>(0, _Decodefs.object)((get$)=>{
731
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5;
732
+ return new InstrumentMapEntry((objectArg = get$.Required, objectArg.Field("instrumentType", _Decodefs.string)), (0, _Option.defaultArg)((objectArg_1 = get$.Optional, objectArg_1.Field("formCode", _Decodefs.string)), ""), (objectArg_2 = get$.Optional, objectArg_2.Field("maxScore", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_3 = get$.Required, objectArg_3.Field("source", _Decodefs.string)), (objectArg_4 = get$.Required, objectArg_4.Field("archived", _Decodefs.bool)), (objectArg_5 = get$.Required, objectArg_5.Field("formName", _Decodefs.string)));
733
+ }, path_5, v);
734
+ const codeExtractionStatsDecoder = (path_1)=>(v)=>(0, _Decodefs.object)((get$)=>{
735
+ let objectArg, objectArg_1, arg_5, objectArg_2, objectArg_3;
736
+ return new CodeExtractionStats((objectArg = get$.Required, objectArg.Field("extracted", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("generated", (0, _Util.uncurry2)(_Decodefs.int))), (arg_5 = dictDecoder((0, _Util.uncurry2)(_Decodefs.int)), objectArg_2 = get$.Required, objectArg_2.Field("bySource", (0, _Util.uncurry2)(arg_5))), (objectArg_3 = get$.Required, objectArg_3.Field("regex", _Decodefs.string)));
737
+ }, path_1, v);
738
+ const statsDecoder = (path)=>(v)=>(0, _Decodefs.object)((get$)=>{
739
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, arg_11, objectArg_5, arg_13, objectArg_6, objectArg_7;
740
+ return new TemplateStats((objectArg = get$.Required, objectArg.Field("totalForms", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("withCodes", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_2 = get$.Required, objectArg_2.Field("withSyntheticCodes", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_3 = get$.Required, objectArg_3.Field("withScoring", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_4 = get$.Required, objectArg_4.Field("withSignature", (0, _Util.uncurry2)(_Decodefs.int))), (arg_11 = dictDecoder((0, _Util.uncurry2)(_Decodefs.int)), objectArg_5 = get$.Required, objectArg_5.Field("byUsage", (0, _Util.uncurry2)(arg_11))), (arg_13 = dictDecoder((0, _Util.uncurry2)(_Decodefs.int)), objectArg_6 = get$.Required, objectArg_6.Field("byElementType", (0, _Util.uncurry2)(arg_13))), (objectArg_7 = get$.Required, objectArg_7.Field("codeExtraction", (0, _Util.uncurry2)(codeExtractionStatsDecoder))));
741
+ }, path, v);
742
+ const coreEmrDecoder = (path_2)=>(v)=>(0, _Decodefs.object)((get$)=>{
743
+ let objectArg, objectArg_1, objectArg_2;
744
+ return new CoreEmrInfo((objectArg = get$.Required, objectArg.Field("appVersion", _Decodefs.string)), (objectArg_1 = get$.Required, objectArg_1.Field("schemaVersion", _Decodefs.string)), (objectArg_2 = get$.Required, objectArg_2.Field("schemaRevision", (0, _Util.uncurry2)(_Decodefs.int))));
745
+ }, path_2, v);
746
+ const instrumentMapStatsDecoder = (path)=>(v)=>(0, _Decodefs.object)((get$)=>{
747
+ let objectArg, objectArg_1, objectArg_2, arg_7, objectArg_3, arg_9, objectArg_4;
748
+ return new InstrumentMapStats((objectArg = get$.Required, objectArg.Field("total", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_1 = get$.Required, objectArg_1.Field("current", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_2 = get$.Required, objectArg_2.Field("archived", (0, _Util.uncurry2)(_Decodefs.int))), (arg_7 = dictDecoder((0, _Util.uncurry2)(_Decodefs.int)), objectArg_3 = get$.Required, objectArg_3.Field("bySource", (0, _Util.uncurry2)(arg_7))), (arg_9 = dictDecoder((0, _Util.uncurry2)(_Decodefs.int)), objectArg_4 = get$.Required, objectArg_4.Field("byType", (0, _Util.uncurry2)(arg_9))));
749
+ }, path, v);
750
+ const manifestDecoder = (path_3)=>(v)=>(0, _Decodefs.object)((get$)=>{
751
+ let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, arg_13, objectArg_6, arg_15, objectArg_7, arg_17, objectArg_8, objectArg_9;
752
+ return new TemplateManifest((objectArg = get$.Optional, objectArg.Field("$schema", _Decodefs.string)), (objectArg_1 = get$.Required, objectArg_1.Field("version", (0, _Util.uncurry2)(_Decodefs.int))), (objectArg_2 = get$.Required, objectArg_2.Field("generatedAt", _Decodefs.string)), (objectArg_3 = get$.Required, objectArg_3.Field("generatedFrom", _Decodefs.string)), (objectArg_4 = get$.Required, objectArg_4.Field("coreEmr", (0, _Util.uncurry2)(coreEmrDecoder))), (objectArg_5 = get$.Required, objectArg_5.Field("stats", (0, _Util.uncurry2)(statsDecoder))), (arg_13 = dictDecoder((0, _Util.uncurry2)(elementTypeDecoder)), objectArg_6 = get$.Required, objectArg_6.Field("elementTypes", (0, _Util.uncurry2)(arg_13))), (arg_15 = dictDecoder((0, _Util.uncurry2)(formDecoder)), objectArg_7 = get$.Required, objectArg_7.Field("forms", (0, _Util.uncurry2)(arg_15))), (arg_17 = dictDecoder((0, _Util.uncurry2)(instrumentMapEntryDecoder)), objectArg_8 = get$.Required, objectArg_8.Field("instrumentMap", (0, _Util.uncurry2)(arg_17))), (objectArg_9 = get$.Required, objectArg_9.Field("instrumentMapStats", (0, _Util.uncurry2)(instrumentMapStatsDecoder))));
753
+ }, path_3, v);
754
+ function toCoreMRChoice(itemId, c) {
755
+ return new _CoreMRTypes.CoreMRChoice(c.ChoiceId, itemId, c.Sequence, c.Text, c.Score, c.BitPosition, c.Code, (0, _Option.map)(_Util.int32ToString, c.Highlight));
756
+ }
757
+ function toCoreMRItem(item) {
758
+ return new _CoreMRTypes.CoreMRItem(item.ItemId, item.Sequence, item.NestingLevel, item.SequenceText, item.Type, (0, _Util.int32ToString)(item.Type), !(0, _List.isEmpty)(item.Choices), true, false, item.Text, item.IsRequired, item.GenderRequired, (0, _Option.map)(_Util.int32ToString, item.Highlight), item.Code, item.Uuid, undefined, undefined, 0, 0, undefined);
759
+ }
760
+ function toCoreMRFormData(form) {
761
+ return new _CoreMRTypes.CoreMRFormData(new _CoreMRTypes.CoreMRFormMetadata(form.FormId, form.Name, (0, _String.isNullOrEmpty)(form.Description) ? undefined : form.Description, ~~(0, _BigInt.toInt32)(form.CurrentVersionId), 1, undefined, form.RequiresSignature, form.IsIntake, "", ""), (0, _List.map)(toCoreMRItem, form.Items), (0, _List.collect)((item_1)=>(0, _List.map)((c)=>toCoreMRChoice(item_1.ItemId, c), item_1.Choices), form.Items), (0, _List.empty)(), (0, _List.empty)());
762
+ }
763
+ function decodeManifest(json) {
764
+ return (0, _Decodefs.fromString)((0, _Util.uncurry2)(manifestDecoder), json);
765
+ }
766
+ function decodeTemplateForm(json) {
767
+ return (0, _Decodefs.fromString)((0, _Util.uncurry2)(formDecoder), json);
768
+ }
769
+ const templateFormDecoder = formDecoder; //# sourceMappingURL=TemplateManifestDecoder.ts.map
770
+
771
+ //# sourceMappingURL=TemplateManifestDecoder.js.map