@f1studio/form-spec 5.0.0-alpha.165 → 5.0.0-alpha.167
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.
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts +13 -13
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js +25 -121
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.js +13 -4
- package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.js.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +98 -27
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +500 -81
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
- package/FormSpec.FS/Interop/Facade/FormItemLookup.d.ts +95 -0
- package/FormSpec.FS/Interop/Facade/FormItemLookup.d.ts.map +1 -0
- package/FormSpec.FS/Interop/Facade/FormItemLookup.js +155 -0
- package/FormSpec.FS/Interop/Facade/FormItemLookup.js.map +1 -0
- package/README.md +7 -7
- package/package.json +5 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts +44 -105
- package/src/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.ts +11 -2
- package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +469 -82
- package/src/FormSpec.FS/Interop/Facade/FormItemLookup.ts +179 -0
|
@@ -48,6 +48,12 @@ _export(exports, {
|
|
|
48
48
|
get EncounterTypes_$reflection () {
|
|
49
49
|
return EncounterTypes_$reflection;
|
|
50
50
|
},
|
|
51
|
+
get FormDeclarations () {
|
|
52
|
+
return FormDeclarations;
|
|
53
|
+
},
|
|
54
|
+
get FormDeclarations_$reflection () {
|
|
55
|
+
return FormDeclarations_$reflection;
|
|
56
|
+
},
|
|
51
57
|
get FormScoring () {
|
|
52
58
|
return FormScoring;
|
|
53
59
|
},
|
|
@@ -72,6 +78,51 @@ _export(exports, {
|
|
|
72
78
|
get ItemTrigger_$reflection () {
|
|
73
79
|
return ItemTrigger_$reflection;
|
|
74
80
|
},
|
|
81
|
+
get ReleaseAvailability$1 () {
|
|
82
|
+
return ReleaseAvailability$1;
|
|
83
|
+
},
|
|
84
|
+
get ReleaseAvailability$1_$reflection () {
|
|
85
|
+
return ReleaseAvailability$1_$reflection;
|
|
86
|
+
},
|
|
87
|
+
get ReleaseAvailability$1_NotInRelease () {
|
|
88
|
+
return ReleaseAvailability$1_NotInRelease;
|
|
89
|
+
},
|
|
90
|
+
get ReleaseAvailability$1_NotReadYet () {
|
|
91
|
+
return ReleaseAvailability$1_NotReadYet;
|
|
92
|
+
},
|
|
93
|
+
get ReleaseAvailability$1_Stated () {
|
|
94
|
+
return ReleaseAvailability$1_Stated;
|
|
95
|
+
},
|
|
96
|
+
get ReleaseAvailability_because () {
|
|
97
|
+
return ReleaseAvailability_because;
|
|
98
|
+
},
|
|
99
|
+
get ReleaseAvailability_describe () {
|
|
100
|
+
return ReleaseAvailability_describe;
|
|
101
|
+
},
|
|
102
|
+
get ReleaseAvailability_kind () {
|
|
103
|
+
return ReleaseAvailability_kind;
|
|
104
|
+
},
|
|
105
|
+
get ReleaseAvailability_map () {
|
|
106
|
+
return ReleaseAvailability_map;
|
|
107
|
+
},
|
|
108
|
+
get ReleaseAvailability_readList () {
|
|
109
|
+
return ReleaseAvailability_readList;
|
|
110
|
+
},
|
|
111
|
+
get ReleaseAvailability_renderDepth () {
|
|
112
|
+
return ReleaseAvailability_renderDepth;
|
|
113
|
+
},
|
|
114
|
+
get ReleaseAvailability_statedTrue () {
|
|
115
|
+
return ReleaseAvailability_statedTrue;
|
|
116
|
+
},
|
|
117
|
+
get ReleaseAvailability_witness () {
|
|
118
|
+
return ReleaseAvailability_witness;
|
|
119
|
+
},
|
|
120
|
+
get ScoringCatalog () {
|
|
121
|
+
return ScoringCatalog;
|
|
122
|
+
},
|
|
123
|
+
get ScoringCatalog_$reflection () {
|
|
124
|
+
return ScoringCatalog_$reflection;
|
|
125
|
+
},
|
|
75
126
|
get ScoringLabel () {
|
|
76
127
|
return ScoringLabel;
|
|
77
128
|
},
|
|
@@ -129,29 +180,171 @@ _export(exports, {
|
|
|
129
180
|
get carriesTextOrDate () {
|
|
130
181
|
return carriesTextOrDate;
|
|
131
182
|
},
|
|
183
|
+
get declaresNothing () {
|
|
184
|
+
return declaresNothing;
|
|
185
|
+
},
|
|
132
186
|
get decodeManifest () {
|
|
133
187
|
return decodeManifest;
|
|
134
188
|
},
|
|
135
189
|
get decodeTemplateForm () {
|
|
136
190
|
return decodeTemplateForm;
|
|
137
191
|
},
|
|
192
|
+
get releaseAvailabilityDecoder () {
|
|
193
|
+
return releaseAvailabilityDecoder;
|
|
194
|
+
},
|
|
138
195
|
get templateFormDecoder () {
|
|
139
196
|
return templateFormDecoder;
|
|
140
|
-
},
|
|
141
|
-
get toCoreMRFormData () {
|
|
142
|
-
return toCoreMRFormData;
|
|
143
197
|
}
|
|
144
198
|
});
|
|
145
199
|
const _Types = require("@fable-org/fable-library-js/Types.js");
|
|
146
|
-
const
|
|
200
|
+
const _List = require("@fable-org/fable-library-js/List.js");
|
|
201
|
+
const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
|
|
147
202
|
const _Option = require("@fable-org/fable-library-js/Option.js");
|
|
203
|
+
const _String = require("@fable-org/fable-library-js/String.js");
|
|
148
204
|
const _Util = require("@fable-org/fable-library-js/Util.js");
|
|
149
|
-
const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
|
|
150
|
-
const _List = require("@fable-org/fable-library-js/List.js");
|
|
151
205
|
const _Map = require("@fable-org/fable-library-js/Map.js");
|
|
152
206
|
const _Decode = require("../../../Thoth.Json/packages/Thoth.Json/Decode.js");
|
|
153
|
-
const
|
|
154
|
-
const
|
|
207
|
+
const _Result = require("@fable-org/fable-library-js/Result.js");
|
|
208
|
+
const _Seq = require("@fable-org/fable-library-js/Seq.js");
|
|
209
|
+
function ReleaseAvailability$1_Stated(Item) {
|
|
210
|
+
return new ReleaseAvailability$1(0, [
|
|
211
|
+
Item
|
|
212
|
+
]);
|
|
213
|
+
}
|
|
214
|
+
function ReleaseAvailability$1_NotInRelease(because) {
|
|
215
|
+
return new ReleaseAvailability$1(1, [
|
|
216
|
+
because
|
|
217
|
+
]);
|
|
218
|
+
}
|
|
219
|
+
function ReleaseAvailability$1_NotReadYet(because, witness) {
|
|
220
|
+
return new ReleaseAvailability$1(2, [
|
|
221
|
+
because,
|
|
222
|
+
witness
|
|
223
|
+
]);
|
|
224
|
+
}
|
|
225
|
+
class ReleaseAvailability$1 extends _Types.Union {
|
|
226
|
+
cases() {
|
|
227
|
+
return [
|
|
228
|
+
"Stated",
|
|
229
|
+
"NotInRelease",
|
|
230
|
+
"NotReadYet"
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
constructor(tag, fields){
|
|
234
|
+
super(), this.tag = tag, this.fields = fields;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function ReleaseAvailability$1_$reflection(gen0) {
|
|
238
|
+
return (0, _Reflection.union_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.ReleaseAvailability`1", [
|
|
239
|
+
gen0
|
|
240
|
+
], ReleaseAvailability$1, ()=>[
|
|
241
|
+
[
|
|
242
|
+
[
|
|
243
|
+
"Item",
|
|
244
|
+
gen0
|
|
245
|
+
]
|
|
246
|
+
],
|
|
247
|
+
[
|
|
248
|
+
[
|
|
249
|
+
"because",
|
|
250
|
+
_Reflection.string_type
|
|
251
|
+
]
|
|
252
|
+
],
|
|
253
|
+
[
|
|
254
|
+
[
|
|
255
|
+
"because",
|
|
256
|
+
_Reflection.string_type
|
|
257
|
+
],
|
|
258
|
+
[
|
|
259
|
+
"witness",
|
|
260
|
+
(0, _Reflection.list_type)(_Reflection.string_type)
|
|
261
|
+
]
|
|
262
|
+
]
|
|
263
|
+
]);
|
|
264
|
+
}
|
|
265
|
+
function ReleaseAvailability_kind(a) {
|
|
266
|
+
switch(a.tag){
|
|
267
|
+
case /* NotInRelease */ 1:
|
|
268
|
+
return "notInRelease";
|
|
269
|
+
case /* NotReadYet */ 2:
|
|
270
|
+
return "notReadYet";
|
|
271
|
+
default:
|
|
272
|
+
return "stated";
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function ReleaseAvailability_because(a) {
|
|
276
|
+
switch(a.tag){
|
|
277
|
+
case /* NotInRelease */ 1:
|
|
278
|
+
return a.fields[0];
|
|
279
|
+
case /* NotReadYet */ 2:
|
|
280
|
+
return a.fields[0];
|
|
281
|
+
default:
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function ReleaseAvailability_witness(a) {
|
|
286
|
+
switch(a.tag){
|
|
287
|
+
case /* Stated */ 0:
|
|
288
|
+
case /* NotInRelease */ 1:
|
|
289
|
+
return (0, _List.empty)();
|
|
290
|
+
default:
|
|
291
|
+
return a.fields[1];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function ReleaseAvailability_map(f, a) {
|
|
295
|
+
switch(a.tag){
|
|
296
|
+
case /* NotInRelease */ 1:
|
|
297
|
+
return ReleaseAvailability$1_NotInRelease(a.fields[0]);
|
|
298
|
+
case /* NotReadYet */ 2:
|
|
299
|
+
return ReleaseAvailability$1_NotReadYet(a.fields[0], a.fields[1]);
|
|
300
|
+
default:
|
|
301
|
+
return ReleaseAvailability$1_Stated(f(a.fields[0]));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function ReleaseAvailability_readList(a) {
|
|
305
|
+
switch(a.tag){
|
|
306
|
+
case /* NotInRelease */ 1:
|
|
307
|
+
case /* NotReadYet */ 2:
|
|
308
|
+
return (0, _List.empty)();
|
|
309
|
+
default:
|
|
310
|
+
return a.fields[0];
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function ReleaseAvailability_statedTrue(a) {
|
|
314
|
+
switch(a.tag){
|
|
315
|
+
case /* NotInRelease */ 1:
|
|
316
|
+
case /* NotReadYet */ 2:
|
|
317
|
+
return false;
|
|
318
|
+
default:
|
|
319
|
+
return a.fields[0];
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function ReleaseAvailability_renderDepth(a) {
|
|
323
|
+
switch(a.tag){
|
|
324
|
+
case /* NotInRelease */ 1:
|
|
325
|
+
case /* NotReadYet */ 2:
|
|
326
|
+
return 0;
|
|
327
|
+
default:
|
|
328
|
+
return a.fields[0] | 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function ReleaseAvailability_describe(a) {
|
|
332
|
+
switch(a.tag){
|
|
333
|
+
case /* NotInRelease */ 1:
|
|
334
|
+
{
|
|
335
|
+
const b = a.fields[0];
|
|
336
|
+
return (0, _String.toText)((0, _String.printf)("not in this release: %s"))(b);
|
|
337
|
+
}
|
|
338
|
+
case /* NotReadYet */ 2:
|
|
339
|
+
{
|
|
340
|
+
const b_1 = a.fields[0];
|
|
341
|
+
const arg_2 = (0, _String.join)(", ", a.fields[1]);
|
|
342
|
+
return (0, _String.toText)((0, _String.printf)("stated by this release, NOT READ YET: %s (stated by: %s)"))(b_1)(arg_2);
|
|
343
|
+
}
|
|
344
|
+
default:
|
|
345
|
+
return "stated by this release, and read";
|
|
346
|
+
}
|
|
347
|
+
}
|
|
155
348
|
class TemplateChoice extends _Types.Record {
|
|
156
349
|
constructor(ChoiceId, Sequence, Score, Text$, BitPosition, Code, Highlight){
|
|
157
350
|
super();
|
|
@@ -312,7 +505,7 @@ class TemplateItem extends _Types.Record {
|
|
|
312
505
|
this.ItemId = ItemId | 0;
|
|
313
506
|
this.Sequence = Sequence | 0;
|
|
314
507
|
this.Type = Type | 0;
|
|
315
|
-
this.NestingLevel = NestingLevel
|
|
508
|
+
this.NestingLevel = NestingLevel;
|
|
316
509
|
this.IsRequired = IsRequired;
|
|
317
510
|
this.Text = Text$;
|
|
318
511
|
this.SequenceText = SequenceText;
|
|
@@ -340,7 +533,7 @@ function TemplateItem_$reflection() {
|
|
|
340
533
|
],
|
|
341
534
|
[
|
|
342
535
|
"NestingLevel",
|
|
343
|
-
_Reflection.int32_type
|
|
536
|
+
ReleaseAvailability$1_$reflection(_Reflection.int32_type)
|
|
344
537
|
],
|
|
345
538
|
[
|
|
346
539
|
"IsRequired",
|
|
@@ -376,7 +569,7 @@ function TemplateItem_$reflection() {
|
|
|
376
569
|
],
|
|
377
570
|
[
|
|
378
571
|
"Triggers",
|
|
379
|
-
(0, _Reflection.list_type)(ItemTrigger_$reflection())
|
|
572
|
+
ReleaseAvailability$1_$reflection((0, _Reflection.list_type)(ItemTrigger_$reflection()))
|
|
380
573
|
]
|
|
381
574
|
]);
|
|
382
575
|
}
|
|
@@ -405,7 +598,7 @@ function EncounterTypes_$reflection() {
|
|
|
405
598
|
],
|
|
406
599
|
[
|
|
407
600
|
"Other",
|
|
408
|
-
_Reflection.bool_type
|
|
601
|
+
ReleaseAvailability$1_$reflection(_Reflection.bool_type)
|
|
409
602
|
]
|
|
410
603
|
]);
|
|
411
604
|
}
|
|
@@ -731,17 +924,15 @@ function TriggerStats_$reflection() {
|
|
|
731
924
|
]);
|
|
732
925
|
}
|
|
733
926
|
class TemplateStats extends _Types.Record {
|
|
734
|
-
constructor(TotalForms, WithCodes, WithSyntheticCodes,
|
|
927
|
+
constructor(TotalForms, WithCodes, WithSyntheticCodes, WithSignature, ByUsage, ByElementType, CodeExtraction){
|
|
735
928
|
super();
|
|
736
929
|
this.TotalForms = TotalForms | 0;
|
|
737
930
|
this.WithCodes = WithCodes | 0;
|
|
738
931
|
this.WithSyntheticCodes = WithSyntheticCodes | 0;
|
|
739
|
-
this.WithScoring = WithScoring | 0;
|
|
740
932
|
this.WithSignature = WithSignature | 0;
|
|
741
933
|
this.ByUsage = ByUsage;
|
|
742
934
|
this.ByElementType = ByElementType;
|
|
743
935
|
this.CodeExtraction = CodeExtraction;
|
|
744
|
-
this.TriggerStats = TriggerStats;
|
|
745
936
|
}
|
|
746
937
|
}
|
|
747
938
|
function TemplateStats_$reflection() {
|
|
@@ -758,10 +949,6 @@ function TemplateStats_$reflection() {
|
|
|
758
949
|
"WithSyntheticCodes",
|
|
759
950
|
_Reflection.int32_type
|
|
760
951
|
],
|
|
761
|
-
[
|
|
762
|
-
"WithScoring",
|
|
763
|
-
_Reflection.int32_type
|
|
764
|
-
],
|
|
765
952
|
[
|
|
766
953
|
"WithSignature",
|
|
767
954
|
_Reflection.int32_type
|
|
@@ -783,10 +970,6 @@ function TemplateStats_$reflection() {
|
|
|
783
970
|
[
|
|
784
971
|
"CodeExtraction",
|
|
785
972
|
CodeExtractionStats_$reflection()
|
|
786
|
-
],
|
|
787
|
-
[
|
|
788
|
-
"TriggerStats",
|
|
789
|
-
(0, _Reflection.option_type)(TriggerStats_$reflection())
|
|
790
973
|
]
|
|
791
974
|
]);
|
|
792
975
|
}
|
|
@@ -854,8 +1037,35 @@ function InstrumentMapStats_$reflection() {
|
|
|
854
1037
|
]
|
|
855
1038
|
]);
|
|
856
1039
|
}
|
|
1040
|
+
class ScoringCatalog extends _Types.Record {
|
|
1041
|
+
constructor(InstrumentMap, InstrumentMapStats, FormsWithScoring){
|
|
1042
|
+
super();
|
|
1043
|
+
this.InstrumentMap = InstrumentMap;
|
|
1044
|
+
this.InstrumentMapStats = InstrumentMapStats;
|
|
1045
|
+
this.FormsWithScoring = FormsWithScoring | 0;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
function ScoringCatalog_$reflection() {
|
|
1049
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.ScoringCatalog", [], ScoringCatalog, ()=>[
|
|
1050
|
+
[
|
|
1051
|
+
"InstrumentMap",
|
|
1052
|
+
(0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
|
|
1053
|
+
_Reflection.string_type,
|
|
1054
|
+
InstrumentMapEntry_$reflection()
|
|
1055
|
+
])
|
|
1056
|
+
],
|
|
1057
|
+
[
|
|
1058
|
+
"InstrumentMapStats",
|
|
1059
|
+
InstrumentMapStats_$reflection()
|
|
1060
|
+
],
|
|
1061
|
+
[
|
|
1062
|
+
"FormsWithScoring",
|
|
1063
|
+
_Reflection.int32_type
|
|
1064
|
+
]
|
|
1065
|
+
]);
|
|
1066
|
+
}
|
|
857
1067
|
class TemplateManifest extends _Types.Record {
|
|
858
|
-
constructor(Schema, Version, GeneratedAt, GeneratedFrom, CoreEmr, Stats, ElementTypes, ElementTypesFrom, Forms,
|
|
1068
|
+
constructor(Schema, Version, GeneratedAt, GeneratedFrom, CoreEmr, Stats, ElementTypes, ElementTypesFrom, Forms, Scoring, Triggers){
|
|
859
1069
|
super();
|
|
860
1070
|
this.Schema = Schema;
|
|
861
1071
|
this.Version = Version | 0;
|
|
@@ -866,8 +1076,8 @@ class TemplateManifest extends _Types.Record {
|
|
|
866
1076
|
this.ElementTypes = ElementTypes;
|
|
867
1077
|
this.ElementTypesFrom = ElementTypesFrom;
|
|
868
1078
|
this.Forms = Forms;
|
|
869
|
-
this.
|
|
870
|
-
this.
|
|
1079
|
+
this.Scoring = Scoring;
|
|
1080
|
+
this.Triggers = Triggers;
|
|
871
1081
|
}
|
|
872
1082
|
}
|
|
873
1083
|
function TemplateManifest_$reflection() {
|
|
@@ -915,15 +1125,12 @@ function TemplateManifest_$reflection() {
|
|
|
915
1125
|
])
|
|
916
1126
|
],
|
|
917
1127
|
[
|
|
918
|
-
"
|
|
919
|
-
(
|
|
920
|
-
_Reflection.string_type,
|
|
921
|
-
InstrumentMapEntry_$reflection()
|
|
922
|
-
])
|
|
1128
|
+
"Scoring",
|
|
1129
|
+
ReleaseAvailability$1_$reflection(ScoringCatalog_$reflection())
|
|
923
1130
|
],
|
|
924
1131
|
[
|
|
925
|
-
"
|
|
926
|
-
|
|
1132
|
+
"Triggers",
|
|
1133
|
+
ReleaseAvailability$1_$reflection(TriggerStats_$reflection())
|
|
927
1134
|
]
|
|
928
1135
|
]);
|
|
929
1136
|
}
|
|
@@ -936,6 +1143,119 @@ function dictDecoder(decoder) {
|
|
|
936
1143
|
Compare: _Util.comparePrimitives
|
|
937
1144
|
}), (0, _Util.uncurry2)(d), path_1, value_1);
|
|
938
1145
|
}
|
|
1146
|
+
function orFail(d) {
|
|
1147
|
+
const decoder = d;
|
|
1148
|
+
return (path_1)=>(value)=>(0, _Decode.andThen)((0, _Util.uncurry3)((r)=>{
|
|
1149
|
+
if (r.tag === /* Error */ 1) {
|
|
1150
|
+
const msg = r.fields[0];
|
|
1151
|
+
return (path)=>(arg20$0040_1)=>(0, _Decode.fail)(msg, path, arg20$0040_1);
|
|
1152
|
+
} else {
|
|
1153
|
+
const v = r.fields[0];
|
|
1154
|
+
return (arg10$0040)=>(arg20$0040)=>(0, _Decode.succeed)(v, arg10$0040, arg20$0040);
|
|
1155
|
+
}
|
|
1156
|
+
}), decoder, path_1, value);
|
|
1157
|
+
}
|
|
1158
|
+
function availabilityRowDecoder(field) {
|
|
1159
|
+
return orFail((path_7, v)=>(0, _Decode.object)((get$)=>{
|
|
1160
|
+
let objectArg_1, objectArg_2, objectArg_3, objectArg_4;
|
|
1161
|
+
let matchValue;
|
|
1162
|
+
const objectArg = get$.Required;
|
|
1163
|
+
matchValue = objectArg.Field("kind", _Decode.string);
|
|
1164
|
+
switch(matchValue){
|
|
1165
|
+
case "stated":
|
|
1166
|
+
return (0, _Result.FSharpResult$2_Ok)(ReleaseAvailability$1_Stated((objectArg_1 = get$.Required, objectArg_1.Field("states", (path_2, value_2)=>(0, _Decode.list)(_Decode.string, path_2, value_2)))));
|
|
1167
|
+
case "notInRelease":
|
|
1168
|
+
return (0, _Result.FSharpResult$2_Ok)(ReleaseAvailability$1_NotInRelease((objectArg_2 = get$.Required, objectArg_2.Field("because", _Decode.string))));
|
|
1169
|
+
case "notReadYet":
|
|
1170
|
+
return (0, _Result.FSharpResult$2_Ok)(ReleaseAvailability$1_NotReadYet((objectArg_3 = get$.Required, objectArg_3.Field("because", _Decode.string)), (objectArg_4 = get$.Required, objectArg_4.Field("witness", (path_6, value_6)=>(0, _Decode.list)(_Decode.string, path_6, value_6)))));
|
|
1171
|
+
default:
|
|
1172
|
+
return (0, _Result.FSharpResult$2_Error)((0, _String.toText)((0, _String.printf)("`%s.kind` = `%s` is not a kind this build understands (stated | notInRelease | notReadYet). ⛔ It is NOT read as an absence: a word this build does not know might mean the release DOES state it"))(field)(matchValue));
|
|
1173
|
+
}
|
|
1174
|
+
}, path_7, v));
|
|
1175
|
+
}
|
|
1176
|
+
function join(field, row, datum) {
|
|
1177
|
+
let matchResult, v, because, because_1, because_2, because_3, witness;
|
|
1178
|
+
if (row != null) {
|
|
1179
|
+
switch((0, _Option.value)(row).tag){
|
|
1180
|
+
case /* NotInRelease */ 1:
|
|
1181
|
+
{
|
|
1182
|
+
if (datum == null) {
|
|
1183
|
+
matchResult = 5;
|
|
1184
|
+
because_2 = (0, _Option.value)(row).fields[0];
|
|
1185
|
+
} else {
|
|
1186
|
+
matchResult = 3;
|
|
1187
|
+
because = (0, _Option.value)(row).fields[0];
|
|
1188
|
+
}
|
|
1189
|
+
break;
|
|
1190
|
+
}
|
|
1191
|
+
case /* NotReadYet */ 2:
|
|
1192
|
+
{
|
|
1193
|
+
if (datum == null) {
|
|
1194
|
+
matchResult = 6;
|
|
1195
|
+
because_3 = (0, _Option.value)(row).fields[0];
|
|
1196
|
+
witness = (0, _Option.value)(row).fields[1];
|
|
1197
|
+
} else {
|
|
1198
|
+
matchResult = 4;
|
|
1199
|
+
because_1 = (0, _Option.value)(row).fields[0];
|
|
1200
|
+
}
|
|
1201
|
+
break;
|
|
1202
|
+
}
|
|
1203
|
+
default:
|
|
1204
|
+
if (datum == null) {
|
|
1205
|
+
matchResult = 2;
|
|
1206
|
+
} else {
|
|
1207
|
+
matchResult = 0;
|
|
1208
|
+
v = (0, _Option.value)(datum);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
} else if (datum == null) {
|
|
1212
|
+
matchResult = 1;
|
|
1213
|
+
} else {
|
|
1214
|
+
matchResult = 0;
|
|
1215
|
+
v = (0, _Option.value)(datum);
|
|
1216
|
+
}
|
|
1217
|
+
switch(matchResult){
|
|
1218
|
+
case 0:
|
|
1219
|
+
return (0, _Result.FSharpResult$2_Ok)(ReleaseAvailability$1_Stated(v));
|
|
1220
|
+
case 1:
|
|
1221
|
+
return (0, _Result.FSharpResult$2_Error)((0, _String.toText)((0, _String.printf)("`%s` is absent and NOTHING DECLARES WHY. An undeclared absence cannot be read: it is indistinguishable from a release that does not state it, from one that states it and was not read, and from a payload that lost it in transit"))(field));
|
|
1222
|
+
case 2:
|
|
1223
|
+
return (0, _Result.FSharpResult$2_Error)((0, _String.toText)((0, _String.printf)("the manifest declares `%s` STATED by this release, but carries no `%s`"))(field)(field));
|
|
1224
|
+
case 3:
|
|
1225
|
+
return (0, _Result.FSharpResult$2_Error)((0, _String.toText)((0, _String.printf)("the manifest declares `%s` NOT IN THIS RELEASE (%s) and carries a value for it anyway"))(field)(because));
|
|
1226
|
+
case 4:
|
|
1227
|
+
return (0, _Result.FSharpResult$2_Error)((0, _String.toText)((0, _String.printf)("the manifest declares `%s` NOT READ YET (%s) and carries a value for it anyway"))(field)(because_1));
|
|
1228
|
+
case 5:
|
|
1229
|
+
return (0, _Result.FSharpResult$2_Ok)(ReleaseAvailability$1_NotInRelease(because_2));
|
|
1230
|
+
default:
|
|
1231
|
+
return (0, _Result.FSharpResult$2_Ok)(ReleaseAvailability$1_NotReadYet(because_3, witness));
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
class FormDeclarations extends _Types.Record {
|
|
1235
|
+
constructor(ItemNesting, Triggers, EncounterOther){
|
|
1236
|
+
super();
|
|
1237
|
+
this.ItemNesting = ItemNesting;
|
|
1238
|
+
this.Triggers = Triggers;
|
|
1239
|
+
this.EncounterOther = EncounterOther;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
function FormDeclarations_$reflection() {
|
|
1243
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.TemplateManifestDecoder.FormDeclarations", [], FormDeclarations, ()=>[
|
|
1244
|
+
[
|
|
1245
|
+
"ItemNesting",
|
|
1246
|
+
(0, _Reflection.option_type)(ReleaseAvailability$1_$reflection((0, _Reflection.list_type)(_Reflection.string_type)))
|
|
1247
|
+
],
|
|
1248
|
+
[
|
|
1249
|
+
"Triggers",
|
|
1250
|
+
(0, _Reflection.option_type)(ReleaseAvailability$1_$reflection((0, _Reflection.list_type)(_Reflection.string_type)))
|
|
1251
|
+
],
|
|
1252
|
+
[
|
|
1253
|
+
"EncounterOther",
|
|
1254
|
+
(0, _Reflection.option_type)(ReleaseAvailability$1_$reflection((0, _Reflection.list_type)(_Reflection.string_type)))
|
|
1255
|
+
]
|
|
1256
|
+
]);
|
|
1257
|
+
}
|
|
1258
|
+
const declaresNothing = new FormDeclarations(undefined, undefined, undefined);
|
|
939
1259
|
const choiceDecoder = (path_2)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
940
1260
|
let objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6;
|
|
941
1261
|
let score;
|
|
@@ -957,14 +1277,51 @@ const itemTriggerDecoder = (path_5)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
|
957
1277
|
let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5;
|
|
958
1278
|
return new ItemTrigger((objectArg = get$.Required, objectArg.Field("triggerId", (0, _Util.uncurry2)(_Decode.int))), (objectArg_1 = get$.Required, objectArg_1.Field("eventName", _Decode.string)), (0, _Option.defaultArg)((objectArg_2 = get$.Optional, objectArg_2.Field("enabled", _Decode.bool)), true), (objectArg_3 = get$.Optional, objectArg_3.Field("exclusiveTag", _Decode.string)), (0, _Option.defaultArg)((objectArg_4 = get$.Optional, objectArg_4.Field("conditions", (path_3, value_4)=>(0, _Decode.list)((0, _Util.uncurry2)(triggerConditionDecoder), path_3, value_4))), (0, _List.empty)()), (0, _Option.defaultArg)((objectArg_5 = get$.Optional, objectArg_5.Field("actions", (path_4, value_6)=>(0, _Decode.list)((0, _Util.uncurry2)(triggerActionDecoder), path_4, value_6))), (0, _List.empty)()));
|
|
959
1279
|
}, path_5, v);
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
const
|
|
1280
|
+
function itemDecoder(declared) {
|
|
1281
|
+
return orFail((path_9, v)=>(0, _Decode.object)((get$)=>{
|
|
1282
|
+
let objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, objectArg_9, objectArg_10, objectArg_11, objectArg_12;
|
|
1283
|
+
let itemId;
|
|
1284
|
+
const objectArg = get$.Required;
|
|
1285
|
+
itemId = objectArg.Field("itemId", (0, _Util.uncurry2)(_Decode.int));
|
|
1286
|
+
const path = (f)=>(0, _String.toText)((0, _String.printf)("forms[].items[itemId=%d].%s"))(itemId)(f);
|
|
1287
|
+
const nesting = join(path("nestingLevel"), declared.ItemNesting, (objectArg_1 = get$.Optional, objectArg_1.Field("nestingLevel", (0, _Util.uncurry2)(_Decode.int))));
|
|
1288
|
+
const triggers = join(path("triggers"), declared.Triggers, (objectArg_2 = get$.Optional, objectArg_2.Field("triggers", (path_1, value)=>(0, _Decode.list)((0, _Util.uncurry2)(itemTriggerDecoder), path_1, value))));
|
|
1289
|
+
let matchResult, itemTriggers, nestingLevel, e;
|
|
1290
|
+
const copyOfStruct = nesting;
|
|
1291
|
+
if (copyOfStruct.tag === /* Error */ 1) {
|
|
1292
|
+
matchResult = 1;
|
|
1293
|
+
e = copyOfStruct.fields[0];
|
|
1294
|
+
} else {
|
|
1295
|
+
const copyOfStruct_1 = triggers;
|
|
1296
|
+
if (copyOfStruct_1.tag === /* Error */ 1) {
|
|
1297
|
+
matchResult = 1;
|
|
1298
|
+
e = copyOfStruct_1.fields[0];
|
|
1299
|
+
} else {
|
|
1300
|
+
matchResult = 0;
|
|
1301
|
+
itemTriggers = copyOfStruct_1.fields[0];
|
|
1302
|
+
nestingLevel = copyOfStruct.fields[0];
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
switch(matchResult){
|
|
1306
|
+
case 0:
|
|
1307
|
+
return (0, _Result.FSharpResult$2_Ok)(new TemplateItem(itemId, (objectArg_3 = get$.Required, objectArg_3.Field("sequence", (0, _Util.uncurry2)(_Decode.int))), (objectArg_4 = get$.Required, objectArg_4.Field("type", (0, _Util.uncurry2)(_Decode.int))), nestingLevel, (objectArg_5 = get$.Required, objectArg_5.Field("isRequired", _Decode.bool)), (objectArg_6 = get$.Required, objectArg_6.Field("text", _Decode.string)), (objectArg_7 = get$.Optional, objectArg_7.Field("sequenceText", _Decode.string)), (objectArg_8 = get$.Optional, objectArg_8.Field("code", _Decode.string)), (objectArg_9 = get$.Optional, objectArg_9.Field("uuid", _Decode.string)), (objectArg_10 = get$.Optional, objectArg_10.Field("genderRequired", _Decode.string)), (objectArg_11 = get$.Optional, objectArg_11.Field("highlight", (0, _Util.uncurry2)(_Decode.int))), (objectArg_12 = get$.Required, objectArg_12.Field("choices", (path_8, value_7)=>(0, _Decode.list)((0, _Util.uncurry2)(choiceDecoder), path_8, value_7))), itemTriggers));
|
|
1308
|
+
default:
|
|
1309
|
+
return (0, _Result.FSharpResult$2_Error)(e);
|
|
1310
|
+
}
|
|
1311
|
+
}, path_9, v));
|
|
1312
|
+
}
|
|
1313
|
+
function encounterTypesDecoder(declared) {
|
|
1314
|
+
return orFail((path_4, v)=>(0, _Decode.object)((get$)=>{
|
|
965
1315
|
let objectArg, objectArg_1, objectArg_2, objectArg_3;
|
|
966
|
-
|
|
967
|
-
|
|
1316
|
+
const matchValue = join("forms[].encounterTypes.other", declared.EncounterOther, (objectArg = get$.Optional, objectArg.Field("other", _Decode.bool)));
|
|
1317
|
+
if (matchValue.tag === /* Error */ 1) {
|
|
1318
|
+
return (0, _Result.FSharpResult$2_Error)(matchValue.fields[0]);
|
|
1319
|
+
} else {
|
|
1320
|
+
const other = matchValue.fields[0];
|
|
1321
|
+
return (0, _Result.FSharpResult$2_Ok)(new EncounterTypes((objectArg_1 = get$.Required, objectArg_1.Field("medical", _Decode.bool)), (objectArg_2 = get$.Required, objectArg_2.Field("mental", _Decode.bool)), (objectArg_3 = get$.Required, objectArg_3.Field("dental", _Decode.bool)), other));
|
|
1322
|
+
}
|
|
1323
|
+
}, path_4, v));
|
|
1324
|
+
}
|
|
968
1325
|
const scoringLabelDecoder = (path_1)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
969
1326
|
let objectArg, objectArg_1;
|
|
970
1327
|
return new ScoringLabel((objectArg = get$.Required, objectArg.Field("name", _Decode.string)), (objectArg_1 = get$.Required, objectArg_1.Field("min", (0, _Util.uncurry2)(_Decode.int))));
|
|
@@ -973,30 +1330,32 @@ const formScoringDecoder = (path_2)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
|
973
1330
|
let objectArg, objectArg_1, objectArg_2, arg_7, objectArg_3;
|
|
974
1331
|
return new FormScoring((objectArg = get$.Required, objectArg.Field("scoreId", (0, _Util.uncurry2)(_Decode.int))), (objectArg_1 = get$.Required, objectArg_1.Field("scoreName", _Decode.string)), (objectArg_2 = get$.Required, objectArg_2.Field("labels", (path_1, value_1)=>(0, _Decode.list)((0, _Util.uncurry2)(scoringLabelDecoder), path_1, value_1))), (arg_7 = dictDecoder((0, _Util.uncurry2)(_Decode.int)), objectArg_3 = get$.Required, objectArg_3.Field("choiceScores", (0, _Util.uncurry2)(arg_7))));
|
|
975
1332
|
}, path_2, v);
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1333
|
+
function formDecoder(declared) {
|
|
1334
|
+
return (path_13)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
1335
|
+
let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, arg_19, objectArg_9, objectArg_10, objectArg_11, objectArg_12, objectArg_13, objectArg_14, arg_31, decoder, objectArg_15, objectArg_16;
|
|
1336
|
+
return new TemplateForm((objectArg = get$.Required, objectArg.Field("formId", (0, _Util.uncurry2)(_Decode.int))), (objectArg_1 = get$.Required, objectArg_1.Field("name", _Decode.string)), (objectArg_2 = get$.Required, objectArg_2.Field("formCode", _Decode.string)), (objectArg_3 = get$.Required, objectArg_3.Field("formCodeSource", _Decode.string)), (objectArg_4 = get$.Required, objectArg_4.Field("description", _Decode.string)), (objectArg_5 = get$.Required, objectArg_5.Field("currentVersionId", (0, _Util.uncurry2)(liberatedInt64Decoder))), (objectArg_6 = get$.Required, objectArg_6.Field("isIntake", _Decode.bool)), (objectArg_7 = get$.Required, objectArg_7.Field("usage", _Decode.string)), (objectArg_8 = get$.Required, objectArg_8.Field("requiresSignature", _Decode.bool)), (arg_19 = encounterTypesDecoder(declared), objectArg_9 = get$.Required, objectArg_9.Field("encounterTypes", (0, _Util.uncurry2)(arg_19))), (objectArg_10 = get$.Required, objectArg_10.Field("onceAYear", _Decode.bool)), (objectArg_11 = get$.Required, objectArg_11.Field("structureHash", _Decode.string)), (objectArg_12 = get$.Required, objectArg_12.Field("clinicalHash", _Decode.string)), (objectArg_13 = get$.Required, objectArg_13.Field("cosmeticHash", _Decode.string)), (objectArg_14 = get$.Required, objectArg_14.Field("hash", _Decode.string)), (arg_31 = (decoder = itemDecoder(declared), (path_12)=>(value_12)=>(0, _Decode.list)((0, _Util.uncurry2)(decoder), path_12, value_12)), objectArg_15 = get$.Required, objectArg_15.Field("items", (0, _Util.uncurry2)(arg_31))), (objectArg_16 = get$.Optional, objectArg_16.Field("scoring", (0, _Util.uncurry2)(formScoringDecoder))));
|
|
1337
|
+
}, path_13, v);
|
|
1338
|
+
}
|
|
980
1339
|
const elementTypeDecoder = (path_2)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
981
1340
|
let objectArg, objectArg_1;
|
|
982
1341
|
return new ElementTypeEntry((objectArg = get$.Required, objectArg.Field("label", _Decode.string)), (objectArg_1 = get$.Required, objectArg_1.Field("control", _Decode.string)));
|
|
983
1342
|
}, path_2, v);
|
|
984
|
-
const elementTypesFromDecoder = (path_6
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1343
|
+
const elementTypesFromDecoder = orFail((path_6, v)=>(0, _Decode.object)((get$)=>{
|
|
1344
|
+
let objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5;
|
|
1345
|
+
let matchValue;
|
|
1346
|
+
const objectArg = get$.Required;
|
|
1347
|
+
matchValue = objectArg.Field("statedBy", _Decode.string);
|
|
1348
|
+
switch(matchValue){
|
|
1349
|
+
case "site":
|
|
1350
|
+
return (0, _Result.FSharpResult$2_Ok)(ElementTypesFrom_StatedBy((objectArg_1 = get$.Required, objectArg_1.Field("table", _Decode.string)), (objectArg_2 = get$.Required, objectArg_2.Field("key", _Decode.string)), (objectArg_3 = get$.Required, objectArg_3.Field("label", _Decode.string))));
|
|
1351
|
+
case "conduit":
|
|
1352
|
+
return (0, _Result.FSharpResult$2_Ok)(ElementTypesFrom_DeclaredByConduit((objectArg_4 = get$.Required, objectArg_4.Field("because", _Decode.string))));
|
|
1353
|
+
case "nobody":
|
|
1354
|
+
return (0, _Result.FSharpResult$2_Ok)(ElementTypesFrom_NotInRelease((objectArg_5 = get$.Required, objectArg_5.Field("because", _Decode.string))));
|
|
1355
|
+
default:
|
|
1356
|
+
return (0, _Result.FSharpResult$2_Error)((0, _String.toText)((0, _String.printf)("`elementTypesFrom.statedBy` = `%s` is not a provenance this build understands (site | conduit | nobody)"))(matchValue));
|
|
1357
|
+
}
|
|
1358
|
+
}, path_6, v));
|
|
1000
1359
|
const instrumentMapEntryDecoder = (path_5)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
1001
1360
|
let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, objectArg_5;
|
|
1002
1361
|
return new InstrumentMapEntry((objectArg = get$.Required, objectArg.Field("instrumentType", _Decode.string)), (0, _Option.defaultArg)((objectArg_1 = get$.Optional, objectArg_1.Field("formCode", _Decode.string)), ""), (objectArg_2 = get$.Optional, objectArg_2.Field("maxScore", (0, _Util.uncurry2)(_Decode.int))), (objectArg_3 = get$.Required, objectArg_3.Field("source", _Decode.string)), (objectArg_4 = get$.Required, objectArg_4.Field("archived", _Decode.bool)), (objectArg_5 = get$.Required, objectArg_5.Field("formName", _Decode.string)));
|
|
@@ -1012,8 +1371,8 @@ const triggerStatsDecoder = (path)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
|
1012
1371
|
})));
|
|
1013
1372
|
}, path, v);
|
|
1014
1373
|
const statsDecoder = (path)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
1015
|
-
let objectArg, objectArg_1, objectArg_2, objectArg_3, objectArg_4, arg_11, objectArg_5,
|
|
1016
|
-
return new TemplateStats((objectArg = get$.Required, objectArg.Field("totalForms", (0, _Util.uncurry2)(_Decode.int))), (objectArg_1 = get$.Required, objectArg_1.Field("withCodes", (0, _Util.uncurry2)(_Decode.int))), (objectArg_2 = get$.Required, objectArg_2.Field("withSyntheticCodes", (0, _Util.uncurry2)(_Decode.int))), (objectArg_3 = get$.Required, objectArg_3.Field("
|
|
1374
|
+
let objectArg, objectArg_1, objectArg_2, objectArg_3, arg_9, objectArg_4, arg_11, objectArg_5, objectArg_6;
|
|
1375
|
+
return new TemplateStats((objectArg = get$.Required, objectArg.Field("totalForms", (0, _Util.uncurry2)(_Decode.int))), (objectArg_1 = get$.Required, objectArg_1.Field("withCodes", (0, _Util.uncurry2)(_Decode.int))), (objectArg_2 = get$.Required, objectArg_2.Field("withSyntheticCodes", (0, _Util.uncurry2)(_Decode.int))), (objectArg_3 = get$.Required, objectArg_3.Field("withSignature", (0, _Util.uncurry2)(_Decode.int))), (arg_9 = dictDecoder((0, _Util.uncurry2)(_Decode.int)), objectArg_4 = get$.Required, objectArg_4.Field("byUsage", (0, _Util.uncurry2)(arg_9))), (arg_11 = dictDecoder((0, _Util.uncurry2)(_Decode.int)), objectArg_5 = get$.Required, objectArg_5.Field("byElementType", (0, _Util.uncurry2)(arg_11))), (objectArg_6 = get$.Required, objectArg_6.Field("codeExtraction", (0, _Util.uncurry2)(codeExtractionStatsDecoder))));
|
|
1017
1376
|
}, path, v);
|
|
1018
1377
|
const coreEmrDecoder = (path_2)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
1019
1378
|
let objectArg, objectArg_1, objectArg_2;
|
|
@@ -1023,13 +1382,78 @@ const instrumentMapStatsDecoder = (path)=>(v)=>(0, _Decode.object)((get$)=>{
|
|
|
1023
1382
|
let objectArg, objectArg_1, objectArg_2, arg_7, objectArg_3, arg_9, objectArg_4;
|
|
1024
1383
|
return new InstrumentMapStats((objectArg = get$.Required, objectArg.Field("total", (0, _Util.uncurry2)(_Decode.int))), (objectArg_1 = get$.Required, objectArg_1.Field("current", (0, _Util.uncurry2)(_Decode.int))), (objectArg_2 = get$.Required, objectArg_2.Field("archived", (0, _Util.uncurry2)(_Decode.int))), (arg_7 = dictDecoder((0, _Util.uncurry2)(_Decode.int)), objectArg_3 = get$.Required, objectArg_3.Field("bySource", (0, _Util.uncurry2)(arg_7))), (arg_9 = dictDecoder((0, _Util.uncurry2)(_Decode.int)), objectArg_4 = get$.Required, objectArg_4.Field("byType", (0, _Util.uncurry2)(arg_9))));
|
|
1025
1384
|
}, path, v);
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1385
|
+
function scoringCatalogOf(instrumentMap, instrumentMapStats, withScoring) {
|
|
1386
|
+
let arg;
|
|
1387
|
+
let matchResult, m, s, w;
|
|
1388
|
+
if (instrumentMap == null) {
|
|
1389
|
+
if (instrumentMapStats == null) {
|
|
1390
|
+
if (withScoring == null) {
|
|
1391
|
+
matchResult = 1;
|
|
1392
|
+
} else {
|
|
1393
|
+
matchResult = 2;
|
|
1394
|
+
}
|
|
1395
|
+
} else {
|
|
1396
|
+
matchResult = 2;
|
|
1397
|
+
}
|
|
1398
|
+
} else if (instrumentMapStats != null) {
|
|
1399
|
+
if (withScoring != null) {
|
|
1400
|
+
matchResult = 0;
|
|
1401
|
+
m = (0, _Option.value)(instrumentMap);
|
|
1402
|
+
s = (0, _Option.value)(instrumentMapStats);
|
|
1403
|
+
w = (0, _Option.value)(withScoring);
|
|
1404
|
+
} else {
|
|
1405
|
+
matchResult = 2;
|
|
1406
|
+
}
|
|
1407
|
+
} else {
|
|
1408
|
+
matchResult = 2;
|
|
1409
|
+
}
|
|
1410
|
+
switch(matchResult){
|
|
1411
|
+
case 0:
|
|
1412
|
+
return (0, _Result.FSharpResult$2_Ok)(new ScoringCatalog(m, s, w));
|
|
1413
|
+
case 1:
|
|
1414
|
+
return (0, _Result.FSharpResult$2_Ok)(undefined);
|
|
1415
|
+
default:
|
|
1416
|
+
return (0, _Result.FSharpResult$2_Error)((arg = (0, _String.join)("`, `", (0, _Seq.toList)((0, _Seq.delay)(()=>(0, _Seq.append)(instrumentMap != null ? (0, _Seq.singleton)("instrumentMap") : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(instrumentMapStats != null ? (0, _Seq.singleton)("instrumentMapStats") : (0, _Seq.empty)(), (0, _Seq.delay)(()=>withScoring != null ? (0, _Seq.singleton)("stats.withScoring") : (0, _Seq.empty)()))))))), (0, _String.toText)((0, _String.printf)("the scoring catalog is PARTIAL — `%s` present, the rest absent. One release fact governs all three; half of it cannot be read"))(arg)));
|
|
1417
|
+
}
|
|
1032
1418
|
}
|
|
1419
|
+
const manifestDecoder = orFail((path_3, v)=>(0, _Decode.object)((get$)=>{
|
|
1420
|
+
let arg_1, objectArg, arg_3, objectArg_1, arg_5, objectArg_2, arg_9, objectArg_4, objectArg_5, objectArg_6, objectArg_7, objectArg_8, objectArg_9, objectArg_10, objectArg_11, arg_25, objectArg_12, objectArg_13, arg_29, objectArg_14;
|
|
1421
|
+
const declared = new FormDeclarations((arg_1 = availabilityRowDecoder("itemNestingFrom"), objectArg = get$.Optional, objectArg.Field("itemNestingFrom", (0, _Util.uncurry2)(arg_1))), (arg_3 = availabilityRowDecoder("triggersFrom"), objectArg_1 = get$.Optional, objectArg_1.Field("triggersFrom", (0, _Util.uncurry2)(arg_3))), (arg_5 = availabilityRowDecoder("encounterOtherFrom"), objectArg_2 = get$.Optional, objectArg_2.Field("encounterOtherFrom", (0, _Util.uncurry2)(arg_5))));
|
|
1422
|
+
let scoringRow;
|
|
1423
|
+
const arg_7 = availabilityRowDecoder("scoringFrom");
|
|
1424
|
+
const objectArg_3 = get$.Optional;
|
|
1425
|
+
scoringRow = objectArg_3.Field("scoringFrom", (0, _Util.uncurry2)(arg_7));
|
|
1426
|
+
const scoring = (0, _Result.Result_Bind)((datum)=>join("scoringFrom (instrumentMap + instrumentMapStats + stats.withScoring)", scoringRow, datum), scoringCatalogOf((arg_9 = dictDecoder((0, _Util.uncurry2)(instrumentMapEntryDecoder)), objectArg_4 = get$.Optional, objectArg_4.Field("instrumentMap", (0, _Util.uncurry2)(arg_9))), (objectArg_5 = get$.Optional, objectArg_5.Field("instrumentMapStats", (0, _Util.uncurry2)(instrumentMapStatsDecoder))), get$.Optional.Raw((firstPath, firstValue)=>(0, _Decode.at)((0, _List.ofArray)([
|
|
1427
|
+
"stats",
|
|
1428
|
+
"withScoring"
|
|
1429
|
+
]), (0, _Util.uncurry2)(_Decode.int), firstPath, firstValue))));
|
|
1430
|
+
const triggers = join("triggersFrom (stats.triggerStats)", declared.Triggers, get$.Optional.Raw((firstPath_1, firstValue_1)=>(0, _Decode.at)((0, _List.ofArray)([
|
|
1431
|
+
"stats",
|
|
1432
|
+
"triggerStats"
|
|
1433
|
+
]), (0, _Util.uncurry2)(triggerStatsDecoder), firstPath_1, firstValue_1)));
|
|
1434
|
+
let matchResult, scoringAvailability, triggerAvailability, e;
|
|
1435
|
+
const copyOfStruct = scoring;
|
|
1436
|
+
if (copyOfStruct.tag === /* Error */ 1) {
|
|
1437
|
+
matchResult = 1;
|
|
1438
|
+
e = copyOfStruct.fields[0];
|
|
1439
|
+
} else {
|
|
1440
|
+
const copyOfStruct_1 = triggers;
|
|
1441
|
+
if (copyOfStruct_1.tag === /* Error */ 1) {
|
|
1442
|
+
matchResult = 1;
|
|
1443
|
+
e = copyOfStruct_1.fields[0];
|
|
1444
|
+
} else {
|
|
1445
|
+
matchResult = 0;
|
|
1446
|
+
scoringAvailability = copyOfStruct.fields[0];
|
|
1447
|
+
triggerAvailability = copyOfStruct_1.fields[0];
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
switch(matchResult){
|
|
1451
|
+
case 0:
|
|
1452
|
+
return (0, _Result.FSharpResult$2_Ok)(new TemplateManifest((objectArg_6 = get$.Optional, objectArg_6.Field("$schema", _Decode.string)), (objectArg_7 = get$.Required, objectArg_7.Field("version", (0, _Util.uncurry2)(_Decode.int))), (objectArg_8 = get$.Required, objectArg_8.Field("generatedAt", _Decode.string)), (objectArg_9 = get$.Required, objectArg_9.Field("generatedFrom", _Decode.string)), (objectArg_10 = get$.Required, objectArg_10.Field("coreEmr", (0, _Util.uncurry2)(coreEmrDecoder))), (objectArg_11 = get$.Required, objectArg_11.Field("stats", (0, _Util.uncurry2)(statsDecoder))), (arg_25 = dictDecoder((0, _Util.uncurry2)(elementTypeDecoder)), objectArg_12 = get$.Optional, objectArg_12.Field("elementTypes", (0, _Util.uncurry2)(arg_25))), (0, _Option.defaultArg)((objectArg_13 = get$.Optional, objectArg_13.Field("elementTypesFrom", (0, _Util.uncurry2)(elementTypesFromDecoder))), ElementTypesFrom_NotInRelease("the manifest carried no `elementTypesFrom`, so no provenance for the item-type vocabulary was stated")), (arg_29 = dictDecoder((0, _Util.uncurry2)(formDecoder(declared))), objectArg_14 = get$.Required, objectArg_14.Field("forms", (0, _Util.uncurry2)(arg_29))), scoringAvailability, triggerAvailability));
|
|
1453
|
+
default:
|
|
1454
|
+
return (0, _Result.FSharpResult$2_Error)(e);
|
|
1455
|
+
}
|
|
1456
|
+
}, path_3, v));
|
|
1033
1457
|
function carriesTextOrDate(control) {
|
|
1034
1458
|
let matchResult, c_3;
|
|
1035
1459
|
switch(control){
|
|
@@ -1112,22 +1536,17 @@ function carriesTextOrDate(control) {
|
|
|
1112
1536
|
];
|
|
1113
1537
|
}
|
|
1114
1538
|
}
|
|
1115
|
-
function toCoreMRItem(kinds, item) {
|
|
1116
|
-
let control;
|
|
1117
|
-
const value = `unresolved_${item.Type}`;
|
|
1118
|
-
control = (0, _Option.defaultArg)((0, _Option.map)((k)=>k.Control, (0, _Map.tryFind)((0, _Util.int32ToString)(item.Type), kinds)), value);
|
|
1119
|
-
const patternInput = carriesTextOrDate(control);
|
|
1120
|
-
return new _CoreMRTypes.CoreMRItem(item.ItemId, item.Sequence, item.NestingLevel, item.SequenceText, item.Type, control, !(0, _List.isEmpty)(item.Choices), patternInput[0], patternInput[1], item.Text, item.IsRequired, item.GenderRequired, (0, _Option.map)(_Util.int32ToString, item.Highlight), item.Code, item.Uuid, undefined, undefined, 0, 0, undefined);
|
|
1121
|
-
}
|
|
1122
|
-
function toCoreMRFormData(kinds, form) {
|
|
1123
|
-
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)((item)=>toCoreMRItem(kinds, item), 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)());
|
|
1124
|
-
}
|
|
1125
1539
|
function decodeManifest(json) {
|
|
1126
1540
|
return (0, _Decode.fromString)((0, _Util.uncurry2)(manifestDecoder), json);
|
|
1127
1541
|
}
|
|
1128
|
-
function decodeTemplateForm(json) {
|
|
1129
|
-
return (0, _Decode.fromString)((0, _Util.uncurry2)(formDecoder), json);
|
|
1542
|
+
function decodeTemplateForm(declared, json) {
|
|
1543
|
+
return (0, _Decode.fromString)((0, _Util.uncurry2)(formDecoder(declared)), json);
|
|
1544
|
+
}
|
|
1545
|
+
function templateFormDecoder(declared) {
|
|
1546
|
+
return formDecoder(declared);
|
|
1130
1547
|
}
|
|
1131
|
-
|
|
1548
|
+
function releaseAvailabilityDecoder(field) {
|
|
1549
|
+
return availabilityRowDecoder(field);
|
|
1550
|
+
} //# sourceMappingURL=TemplateManifestDecoder.ts.map
|
|
1132
1551
|
|
|
1133
1552
|
//# sourceMappingURL=TemplateManifestDecoder.js.map
|