@f1studio/form-spec 5.0.0-alpha.167 → 5.0.0-alpha.169

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 (194) hide show
  1. package/FormSpec.FS/BlueprintValidation.d.ts +6 -3
  2. package/FormSpec.FS/BlueprintValidation.d.ts.map +1 -1
  3. package/FormSpec.FS/BlueprintValidation.js +39 -15
  4. package/FormSpec.FS/BlueprintValidation.js.map +1 -1
  5. package/FormSpec.FS/Designer.d.ts.map +1 -1
  6. package/FormSpec.FS/Designer.js +1 -1
  7. package/FormSpec.FS/Designer.js.map +1 -1
  8. package/FormSpec.FS/FormSpec.d.ts +108 -58
  9. package/FormSpec.FS/FormSpec.d.ts.map +1 -1
  10. package/FormSpec.FS/FormSpec.js +319 -129
  11. package/FormSpec.FS/FormSpec.js.map +1 -1
  12. package/FormSpec.FS/FormSpecHelpers.d.ts.map +1 -1
  13. package/FormSpec.FS/FormSpecHelpers.js +1 -1
  14. package/FormSpec.FS/FormSpecHelpers.js.map +1 -1
  15. package/FormSpec.FS/FormSpecValues.d.ts.map +1 -1
  16. package/FormSpec.FS/FormSpecValues.js +5 -2
  17. package/FormSpec.FS/FormSpecValues.js.map +1 -1
  18. package/FormSpec.FS/Helpers.d.ts.map +1 -1
  19. package/FormSpec.FS/Helpers.js +14 -9
  20. package/FormSpec.FS/Helpers.js.map +1 -1
  21. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -1
  22. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +1 -1
  23. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -1
  24. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts +1 -1
  25. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts.map +1 -1
  26. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js +1 -1
  27. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js.map +1 -1
  28. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts +3 -3
  29. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts.map +1 -1
  30. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js +7 -5
  31. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js.map +1 -1
  32. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts.map +1 -1
  33. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js +11 -10
  34. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js.map +1 -1
  35. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts.map +1 -1
  36. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js +1 -9
  37. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js.map +1 -1
  38. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts +11 -4
  39. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts.map +1 -1
  40. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js +30 -28
  41. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js.map +1 -1
  42. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts +3 -9
  43. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts.map +1 -1
  44. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +4 -31
  45. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
  46. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
  47. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +2 -6
  48. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
  49. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImportPipeline.d.ts +45 -0
  50. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImportPipeline.d.ts.map +1 -0
  51. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImportPipeline.js +141 -0
  52. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImportPipeline.js.map +1 -0
  53. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImporterAnalysis.d.ts +326 -0
  54. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImporterAnalysis.d.ts.map +1 -0
  55. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImporterAnalysis.js +1743 -0
  56. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImporterAnalysis.js.map +1 -0
  57. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +8 -8
  58. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
  59. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +6 -6
  60. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
  61. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.d.ts +21 -15
  62. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.d.ts.map +1 -1
  63. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.js +83 -80
  64. package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.js.map +1 -1
  65. package/FormSpec.FS/Integrations/CorEMR/CoreMRPathwayMapper.d.ts +51 -0
  66. package/FormSpec.FS/Integrations/CorEMR/CoreMRPathwayMapper.d.ts.map +1 -0
  67. package/FormSpec.FS/Integrations/CorEMR/CoreMRPathwayMapper.js +939 -0
  68. package/FormSpec.FS/Integrations/CorEMR/CoreMRPathwayMapper.js.map +1 -0
  69. package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts +2 -17
  70. package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts.map +1 -1
  71. package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js +1 -66
  72. package/FormSpec.FS/Integrations/CorEMR/{TemplateManifestDecoder.d.ts → FormTemplateDecoder.d.ts} +53 -45
  73. package/FormSpec.FS/Integrations/CorEMR/FormTemplateDecoder.d.ts.map +1 -0
  74. package/FormSpec.FS/Integrations/CorEMR/{TemplateManifestDecoder.js → FormTemplateDecoder.js} +544 -254
  75. package/FormSpec.FS/Integrations/CorEMR/FormTemplateDecoder.js.map +1 -0
  76. package/FormSpec.FS/Integrations/CorEMR/FormTemplateDomainDecoder.d.ts +7 -0
  77. package/FormSpec.FS/Integrations/CorEMR/FormTemplateDomainDecoder.d.ts.map +1 -0
  78. package/FormSpec.FS/Integrations/CorEMR/FormTemplateDomainDecoder.js +280 -0
  79. package/FormSpec.FS/Integrations/CorEMR/FormTemplateDomainDecoder.js.map +1 -0
  80. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +16 -4
  81. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
  82. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +63 -18
  83. package/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
  84. package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +4 -4
  85. package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
  86. package/FormSpec.FS/Interop/FormSpec.Api.Option.js +2 -2
  87. package/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
  88. package/FormSpec.FS/PathwayDataExtractor.d.ts.map +1 -1
  89. package/FormSpec.FS/PathwayDataExtractor.js +39 -18
  90. package/FormSpec.FS/PathwayDataExtractor.js.map +1 -1
  91. package/FormSpec.FS/PathwayExecutor.d.ts +10 -10
  92. package/FormSpec.FS/PathwayExecutor.d.ts.map +1 -1
  93. package/FormSpec.FS/PathwayExecutor.js +14 -14
  94. package/FormSpec.FS/PathwayExecutor.js.map +1 -1
  95. package/FormSpec.FS/PathwayValidator.d.ts.map +1 -1
  96. package/FormSpec.FS/PathwayValidator.js +8 -5
  97. package/FormSpec.FS/PathwayValidator.js.map +1 -1
  98. package/FormSpec.FS/Provenance.d.ts +15 -7
  99. package/FormSpec.FS/Provenance.d.ts.map +1 -1
  100. package/FormSpec.FS/Provenance.js +11 -11
  101. package/FormSpec.FS/Provenance.js.map +1 -1
  102. package/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -1
  103. package/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js +16 -7
  104. package/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js.map +1 -1
  105. package/FormSpec.FS/Renderers/MermaidRenderer.d.ts.map +1 -1
  106. package/FormSpec.FS/Renderers/MermaidRenderer.js +4 -8
  107. package/FormSpec.FS/Renderers/MermaidRenderer.js.map +1 -1
  108. package/FormSpec.FS/Renderers/PathwayRenderers.d.ts.map +1 -1
  109. package/FormSpec.FS/Renderers/PathwayRenderers.js +5 -4
  110. package/FormSpec.FS/Renderers/PathwayRenderers.js.map +1 -1
  111. package/FormSpec.FS/TriggerActionDto.d.ts +32 -21
  112. package/FormSpec.FS/TriggerActionDto.d.ts.map +1 -1
  113. package/FormSpec.FS/TriggerActionDto.js +247 -61
  114. package/FormSpec.FS/TriggerActionDto.js.map +1 -1
  115. package/README.md +7 -7
  116. package/package.json +1 -1
  117. package/plugins/allergyfinder/src/AllergyFinderField.d.ts.map +1 -1
  118. package/plugins/allergyfinder/src/AllergyFinderField.js +2 -2
  119. package/plugins/allergyfinder/src/AllergyFinderField.js.map +1 -1
  120. package/plugins/bmi/src/BMIField.d.ts.map +1 -1
  121. package/plugins/bmi/src/BMIField.js +21 -15
  122. package/plugins/bmi/src/BMIField.js.map +1 -1
  123. package/plugins/demographics/src/DemographicsField.d.ts.map +1 -1
  124. package/plugins/demographics/src/DemographicsField.js +4 -4
  125. package/plugins/demographics/src/DemographicsField.js.map +1 -1
  126. package/plugins/likert/src/LikertField.d.ts.map +1 -1
  127. package/plugins/likert/src/LikertField.js +40 -35
  128. package/plugins/likert/src/LikertField.js.map +1 -1
  129. package/plugins/signature/src/SignatureField.d.ts.map +1 -1
  130. package/plugins/signature/src/SignatureField.js +4 -3
  131. package/plugins/signature/src/SignatureField.js.map +1 -1
  132. package/plugins/vitals/src/VitalsField.d.ts.map +1 -1
  133. package/plugins/vitals/src/VitalsField.js +4 -4
  134. package/plugins/vitals/src/VitalsField.js.map +1 -1
  135. package/src/FormSpec.FS/BlueprintValidation.ts +55 -24
  136. package/src/FormSpec.FS/Designer.ts +2 -2
  137. package/src/FormSpec.FS/FormSpec.ts +223 -100
  138. package/src/FormSpec.FS/FormSpecHelpers.ts +2 -2
  139. package/src/FormSpec.FS/FormSpecValues.ts +6 -3
  140. package/src/FormSpec.FS/Helpers.ts +16 -11
  141. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +2 -2
  142. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts +3 -3
  143. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts +10 -8
  144. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts +6 -5
  145. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts +1 -10
  146. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts +35 -30
  147. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +7 -26
  148. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +2 -6
  149. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImportPipeline.ts +115 -0
  150. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRImporterAnalysis.ts +1059 -0
  151. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +10 -10
  152. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.ts +61 -88
  153. package/src/FormSpec.FS/Integrations/CorEMR/CoreMRPathwayMapper.ts +926 -0
  154. package/src/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts +3 -37
  155. package/src/FormSpec.FS/Integrations/CorEMR/FormTemplateDecoder.ts +1284 -0
  156. package/src/FormSpec.FS/Integrations/CorEMR/FormTemplateDomainDecoder.ts +287 -0
  157. package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +76 -25
  158. package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +6 -6
  159. package/src/FormSpec.FS/PathwayDataExtractor.ts +40 -20
  160. package/src/FormSpec.FS/PathwayExecutor.ts +26 -26
  161. package/src/FormSpec.FS/PathwayValidator.ts +8 -5
  162. package/src/FormSpec.FS/Provenance.ts +23 -15
  163. package/src/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts +18 -8
  164. package/src/FormSpec.FS/Renderers/MermaidRenderer.ts +6 -10
  165. package/src/FormSpec.FS/Renderers/PathwayRenderers.ts +5 -5
  166. package/src/FormSpec.FS/TriggerActionDto.ts +247 -74
  167. package/src/plugins/allergyfinder/src/AllergyFinderField.ts +3 -3
  168. package/src/plugins/bmi/src/BMIField.ts +12 -5
  169. package/src/plugins/demographics/src/DemographicsField.ts +5 -5
  170. package/src/plugins/likert/src/LikertField.ts +16 -11
  171. package/src/plugins/signature/src/SignatureField.ts +4 -3
  172. package/src/plugins/vitals/src/VitalsField.ts +5 -5
  173. package/src/vye-os-contracts-fs/src/Core/Ids.ts +8 -8
  174. package/src/vye-os-contracts-fs/src/CoreMR/FormTemplate.ts +715 -0
  175. package/vye-os-contracts-fs/src/Core/Ids.d.ts +4 -4
  176. package/vye-os-contracts-fs/src/Core/Ids.d.ts.map +1 -1
  177. package/vye-os-contracts-fs/src/Core/Ids.js +18 -18
  178. package/vye-os-contracts-fs/src/CoreMR/FormTemplate.d.ts +310 -0
  179. package/vye-os-contracts-fs/src/CoreMR/FormTemplate.d.ts.map +1 -0
  180. package/vye-os-contracts-fs/src/CoreMR/FormTemplate.js +1242 -0
  181. package/vye-os-contracts-fs/src/CoreMR/FormTemplate.js.map +1 -0
  182. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts +0 -69
  183. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts.map +0 -1
  184. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js +0 -447
  185. package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js.map +0 -1
  186. package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.d.ts +0 -19
  187. package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.d.ts.map +0 -1
  188. package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.js +0 -643
  189. package/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.js.map +0 -1
  190. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +0 -1
  191. package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +0 -1
  192. package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts +0 -412
  193. package/src/FormSpec.FS/Integrations/CorEMR/ItemTriggerConverter.ts +0 -588
  194. package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +0 -1054
@@ -0,0 +1,1743 @@
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 ActionEquivalence () {
13
+ return ActionEquivalence;
14
+ },
15
+ get ActionEquivalence_$reflection () {
16
+ return ActionEquivalence_$reflection;
17
+ },
18
+ get ActionFormDetail () {
19
+ return ActionFormDetail;
20
+ },
21
+ get ActionFormDetail_$reflection () {
22
+ return ActionFormDetail_$reflection;
23
+ },
24
+ get ConditionEquivalence () {
25
+ return ConditionEquivalence;
26
+ },
27
+ get ConditionEquivalence_$reflection () {
28
+ return ConditionEquivalence_$reflection;
29
+ },
30
+ get EquivalenceStatus () {
31
+ return EquivalenceStatus;
32
+ },
33
+ get EquivalenceStatus_$reflection () {
34
+ return EquivalenceStatus_$reflection;
35
+ },
36
+ get EquivalenceStatus_EquivEquivalent () {
37
+ return EquivalenceStatus_EquivEquivalent;
38
+ },
39
+ get EquivalenceStatus_EquivMismatch () {
40
+ return EquivalenceStatus_EquivMismatch;
41
+ },
42
+ get EquivalenceStatus_EquivMissing () {
43
+ return EquivalenceStatus_EquivMissing;
44
+ },
45
+ get FieldMapping () {
46
+ return FieldMapping;
47
+ },
48
+ get FieldMappingStatus () {
49
+ return FieldMappingStatus;
50
+ },
51
+ get FieldMappingStatus_$reflection () {
52
+ return FieldMappingStatus_$reflection;
53
+ },
54
+ get FieldMappingStatus_Mapped () {
55
+ return FieldMappingStatus_Mapped;
56
+ },
57
+ get FieldMappingStatus_Unsupported () {
58
+ return FieldMappingStatus_Unsupported;
59
+ },
60
+ get FieldMapping_$reflection () {
61
+ return FieldMapping_$reflection;
62
+ },
63
+ get FormDetail () {
64
+ return FormDetail;
65
+ },
66
+ get FormDetail_$reflection () {
67
+ return FormDetail_$reflection;
68
+ },
69
+ get InstrumentDetail () {
70
+ return InstrumentDetail;
71
+ },
72
+ get InstrumentDetail_$reflection () {
73
+ return InstrumentDetail_$reflection;
74
+ },
75
+ get LandingAnalysis () {
76
+ return LandingAnalysis;
77
+ },
78
+ get LandingAnalysis_$reflection () {
79
+ return LandingAnalysis_$reflection;
80
+ },
81
+ get LandingSource () {
82
+ return LandingSource;
83
+ },
84
+ get LandingSource_$reflection () {
85
+ return LandingSource_$reflection;
86
+ },
87
+ get Manifest () {
88
+ return Manifest;
89
+ },
90
+ get ManifestStats () {
91
+ return ManifestStats;
92
+ },
93
+ get ManifestStats_$reflection () {
94
+ return ManifestStats_$reflection;
95
+ },
96
+ get Manifest_$reflection () {
97
+ return Manifest_$reflection;
98
+ },
99
+ get StepMapping () {
100
+ return StepMapping;
101
+ },
102
+ get StepMapping_$reflection () {
103
+ return StepMapping_$reflection;
104
+ },
105
+ get TemplateListItem () {
106
+ return TemplateListItem;
107
+ },
108
+ get TemplateListItem_$reflection () {
109
+ return TemplateListItem_$reflection;
110
+ },
111
+ get TemplateMapping () {
112
+ return TemplateMapping;
113
+ },
114
+ get TemplateMapping_$reflection () {
115
+ return TemplateMapping_$reflection;
116
+ },
117
+ get TemplateStatus () {
118
+ return TemplateStatus;
119
+ },
120
+ get TemplateStatus_$reflection () {
121
+ return TemplateStatus_$reflection;
122
+ },
123
+ get TemplateStatus_Blocked () {
124
+ return TemplateStatus_Blocked;
125
+ },
126
+ get TemplateStatus_Drift () {
127
+ return TemplateStatus_Drift;
128
+ },
129
+ get TemplateStatus_Issues () {
130
+ return TemplateStatus_Issues;
131
+ },
132
+ get TemplateStatus_New () {
133
+ return TemplateStatus_New;
134
+ },
135
+ get TemplateStatus_Ready () {
136
+ return TemplateStatus_Ready;
137
+ },
138
+ get TriggerFormStat () {
139
+ return TriggerFormStat;
140
+ },
141
+ get TriggerFormStat_$reflection () {
142
+ return TriggerFormStat_$reflection;
143
+ },
144
+ get TriggerMapping () {
145
+ return TriggerMapping;
146
+ },
147
+ get TriggerMapping_$reflection () {
148
+ return TriggerMapping_$reflection;
149
+ },
150
+ get TriggerStatus () {
151
+ return TriggerStatus;
152
+ },
153
+ get TriggerStatus_$reflection () {
154
+ return TriggerStatus_$reflection;
155
+ },
156
+ get TriggerStatus_Equivalent () {
157
+ return TriggerStatus_Equivalent;
158
+ },
159
+ get TriggerStatus_Failed () {
160
+ return TriggerStatus_Failed;
161
+ },
162
+ get TriggerStatus_Partial () {
163
+ return TriggerStatus_Partial;
164
+ },
165
+ get TriggerStatus_Pending () {
166
+ return TriggerStatus_Pending;
167
+ },
168
+ get analyse () {
169
+ return analyse;
170
+ },
171
+ get computeStats () {
172
+ return computeStats;
173
+ },
174
+ get getCoreEmrTypeLabel () {
175
+ return getCoreEmrTypeLabel;
176
+ },
177
+ get getF1TypeDisplay () {
178
+ return getF1TypeDisplay;
179
+ },
180
+ get toManifest () {
181
+ return toManifest;
182
+ },
183
+ get toTemplateListFromMappings () {
184
+ return toTemplateListFromMappings;
185
+ },
186
+ get toTemplateMapping () {
187
+ return toTemplateMapping;
188
+ }
189
+ });
190
+ const _Types = require("@fable-org/fable-library-js/Types.js");
191
+ const _FormTemplateDecoder = require("../../CorEMR/FormTemplateDecoder.js");
192
+ const _Map = require("@fable-org/fable-library-js/Map.js");
193
+ const _Util = require("@fable-org/fable-library-js/Util.js");
194
+ const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
195
+ const _Result = require("@fable-org/fable-library-js/Result.js");
196
+ const _CoreMRImportPipeline = require("./CoreMRImportPipeline.js");
197
+ const _Option = require("@fable-org/fable-library-js/Option.js");
198
+ const _List = require("@fable-org/fable-library-js/List.js");
199
+ const _FormSpec = require("../../../FormSpec.js");
200
+ const _Seq2 = require("@fable-org/fable-library-js/Seq2.js");
201
+ const _MapUtil = require("@fable-org/fable-library-js/MapUtil.js");
202
+ const _String = require("@fable-org/fable-library-js/String.js");
203
+ const _Set = require("@fable-org/fable-library-js/Set.js");
204
+ const _CoreMRPathwayMapper = require("../../CorEMR/CoreMRPathwayMapper.js");
205
+ const _CorEMRElementTypeMap = require("./CorEMRElementTypeMap.js");
206
+ const _Array = require("@fable-org/fable-library-js/Array.js");
207
+ const _Double = require("@fable-org/fable-library-js/Double.js");
208
+ const _Seq = require("@fable-org/fable-library-js/Seq.js");
209
+ const _Encode = require("../../../../Thoth.Json/packages/Thoth.Json/Encode.js");
210
+ class LandingSource extends _Types.Record {
211
+ constructor(Version, GeneratedAt, GeneratedFrom, CoreEmr, Stats, Scoring, Triggers, Forms){
212
+ super();
213
+ this.Version = Version | 0;
214
+ this.GeneratedAt = GeneratedAt;
215
+ this.GeneratedFrom = GeneratedFrom;
216
+ this.CoreEmr = CoreEmr;
217
+ this.Stats = Stats;
218
+ this.Scoring = Scoring;
219
+ this.Triggers = Triggers;
220
+ this.Forms = Forms;
221
+ }
222
+ }
223
+ function LandingSource_$reflection() {
224
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.LandingSource", [], LandingSource, ()=>[
225
+ [
226
+ "Version",
227
+ _Reflection.int32_type
228
+ ],
229
+ [
230
+ "GeneratedAt",
231
+ _Reflection.string_type
232
+ ],
233
+ [
234
+ "GeneratedFrom",
235
+ _Reflection.string_type
236
+ ],
237
+ [
238
+ "CoreEmr",
239
+ (0, _FormTemplateDecoder.CoreEmrInfo_$reflection)()
240
+ ],
241
+ [
242
+ "Stats",
243
+ (0, _FormTemplateDecoder.TemplateStats_$reflection)()
244
+ ],
245
+ [
246
+ "Scoring",
247
+ (0, _FormTemplateDecoder.ReleaseAvailability$1_$reflection)((0, _FormTemplateDecoder.ScoringCatalog_$reflection)())
248
+ ],
249
+ [
250
+ "Triggers",
251
+ (0, _FormTemplateDecoder.ReleaseAvailability$1_$reflection)((0, _FormTemplateDecoder.TriggerStats_$reflection)())
252
+ ],
253
+ [
254
+ "Forms",
255
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
256
+ _Reflection.string_type,
257
+ (0, _FormTemplateDecoder.TemplateForm_$reflection)()
258
+ ])
259
+ ]
260
+ ]);
261
+ }
262
+ function ok(v) {
263
+ return (0, _Result.FSharpResult$2_Ok)(v);
264
+ }
265
+ function err(v) {
266
+ return (0, _Result.FSharpResult$2_Error)(v);
267
+ }
268
+ function instrumentsOf(m) {
269
+ return (0, _CoreMRImportPipeline.instrumentsOfScoring)(m.Scoring);
270
+ }
271
+ function TemplateStatus_Ready() {
272
+ return new TemplateStatus(0, []);
273
+ }
274
+ function TemplateStatus_Issues() {
275
+ return new TemplateStatus(1, []);
276
+ }
277
+ function TemplateStatus_Drift() {
278
+ return new TemplateStatus(2, []);
279
+ }
280
+ function TemplateStatus_Blocked() {
281
+ return new TemplateStatus(3, []);
282
+ }
283
+ function TemplateStatus_New() {
284
+ return new TemplateStatus(4, []);
285
+ }
286
+ class TemplateStatus extends _Types.Union {
287
+ cases() {
288
+ return [
289
+ "Ready",
290
+ "Issues",
291
+ "Drift",
292
+ "Blocked",
293
+ "New"
294
+ ];
295
+ }
296
+ constructor(tag, fields){
297
+ super(), this.tag = tag, this.fields = fields;
298
+ }
299
+ }
300
+ function TemplateStatus_$reflection() {
301
+ return (0, _Reflection.union_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.TemplateStatus", [], TemplateStatus, ()=>[
302
+ [],
303
+ [],
304
+ [],
305
+ [],
306
+ []
307
+ ]);
308
+ }
309
+ function FieldMappingStatus_Mapped() {
310
+ return new FieldMappingStatus(0, []);
311
+ }
312
+ function FieldMappingStatus_Unsupported() {
313
+ return new FieldMappingStatus(1, []);
314
+ }
315
+ class FieldMappingStatus extends _Types.Union {
316
+ cases() {
317
+ return [
318
+ "Mapped",
319
+ "Unsupported"
320
+ ];
321
+ }
322
+ constructor(tag, fields){
323
+ super(), this.tag = tag, this.fields = fields;
324
+ }
325
+ }
326
+ function FieldMappingStatus_$reflection() {
327
+ return (0, _Reflection.union_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.FieldMappingStatus", [], FieldMappingStatus, ()=>[
328
+ [],
329
+ []
330
+ ]);
331
+ }
332
+ function TriggerStatus_Equivalent() {
333
+ return new TriggerStatus(0, []);
334
+ }
335
+ function TriggerStatus_Partial() {
336
+ return new TriggerStatus(1, []);
337
+ }
338
+ function TriggerStatus_Failed() {
339
+ return new TriggerStatus(2, []);
340
+ }
341
+ function TriggerStatus_Pending() {
342
+ return new TriggerStatus(3, []);
343
+ }
344
+ class TriggerStatus extends _Types.Union {
345
+ cases() {
346
+ return [
347
+ "Equivalent",
348
+ "Partial",
349
+ "Failed",
350
+ "Pending"
351
+ ];
352
+ }
353
+ constructor(tag, fields){
354
+ super(), this.tag = tag, this.fields = fields;
355
+ }
356
+ }
357
+ function TriggerStatus_$reflection() {
358
+ return (0, _Reflection.union_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.TriggerStatus", [], TriggerStatus, ()=>[
359
+ [],
360
+ [],
361
+ [],
362
+ []
363
+ ]);
364
+ }
365
+ function EquivalenceStatus_EquivEquivalent() {
366
+ return new EquivalenceStatus(0, []);
367
+ }
368
+ function EquivalenceStatus_EquivMismatch() {
369
+ return new EquivalenceStatus(1, []);
370
+ }
371
+ function EquivalenceStatus_EquivMissing() {
372
+ return new EquivalenceStatus(2, []);
373
+ }
374
+ class EquivalenceStatus extends _Types.Union {
375
+ cases() {
376
+ return [
377
+ "EquivEquivalent",
378
+ "EquivMismatch",
379
+ "EquivMissing"
380
+ ];
381
+ }
382
+ constructor(tag, fields){
383
+ super(), this.tag = tag, this.fields = fields;
384
+ }
385
+ }
386
+ function EquivalenceStatus_$reflection() {
387
+ return (0, _Reflection.union_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.EquivalenceStatus", [], EquivalenceStatus, ()=>[
388
+ [],
389
+ [],
390
+ []
391
+ ]);
392
+ }
393
+ class Manifest extends _Types.Record {
394
+ constructor(Source, GeneratedAt, Version, CoreEmrApp, CoreEmrSchema, SchemaRev, Forms, WithCodes, WithScoring, InstrumentTotal, InstrumentCurrent, InstrumentArchived, ScoringFrom, TriggersFrom){
395
+ super();
396
+ this.Source = Source;
397
+ this.GeneratedAt = GeneratedAt;
398
+ this.Version = Version;
399
+ this.CoreEmrApp = CoreEmrApp;
400
+ this.CoreEmrSchema = CoreEmrSchema;
401
+ this.SchemaRev = SchemaRev;
402
+ this.Forms = Forms | 0;
403
+ this.WithCodes = WithCodes | 0;
404
+ this.WithScoring = WithScoring | 0;
405
+ this.InstrumentTotal = InstrumentTotal | 0;
406
+ this.InstrumentCurrent = InstrumentCurrent | 0;
407
+ this.InstrumentArchived = InstrumentArchived | 0;
408
+ this.ScoringFrom = ScoringFrom;
409
+ this.TriggersFrom = TriggersFrom;
410
+ }
411
+ }
412
+ function Manifest_$reflection() {
413
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.Manifest", [], Manifest, ()=>[
414
+ [
415
+ "Source",
416
+ _Reflection.string_type
417
+ ],
418
+ [
419
+ "GeneratedAt",
420
+ _Reflection.string_type
421
+ ],
422
+ [
423
+ "Version",
424
+ _Reflection.string_type
425
+ ],
426
+ [
427
+ "CoreEmrApp",
428
+ _Reflection.string_type
429
+ ],
430
+ [
431
+ "CoreEmrSchema",
432
+ _Reflection.string_type
433
+ ],
434
+ [
435
+ "SchemaRev",
436
+ _Reflection.string_type
437
+ ],
438
+ [
439
+ "Forms",
440
+ _Reflection.int32_type
441
+ ],
442
+ [
443
+ "WithCodes",
444
+ _Reflection.int32_type
445
+ ],
446
+ [
447
+ "WithScoring",
448
+ _Reflection.int32_type
449
+ ],
450
+ [
451
+ "InstrumentTotal",
452
+ _Reflection.int32_type
453
+ ],
454
+ [
455
+ "InstrumentCurrent",
456
+ _Reflection.int32_type
457
+ ],
458
+ [
459
+ "InstrumentArchived",
460
+ _Reflection.int32_type
461
+ ],
462
+ [
463
+ "ScoringFrom",
464
+ (0, _Reflection.option_type)(_Reflection.string_type)
465
+ ],
466
+ [
467
+ "TriggersFrom",
468
+ (0, _Reflection.option_type)(_Reflection.string_type)
469
+ ]
470
+ ]);
471
+ }
472
+ class TemplateListItem extends _Types.Record {
473
+ constructor(TemplateId, TemplateCode, TemplateName, Classification, FieldCount, TriggerCount, HasScoring, HasBlueprintCode, HasInstrumentMapping, IsIntake, EncounterTypes, IssueCount, Instrument, LastImported){
474
+ super();
475
+ this.TemplateId = TemplateId;
476
+ this.TemplateCode = TemplateCode;
477
+ this.TemplateName = TemplateName;
478
+ this.Classification = Classification;
479
+ this.FieldCount = FieldCount | 0;
480
+ this.TriggerCount = TriggerCount | 0;
481
+ this.HasScoring = HasScoring;
482
+ this.HasBlueprintCode = HasBlueprintCode;
483
+ this.HasInstrumentMapping = HasInstrumentMapping;
484
+ this.IsIntake = IsIntake;
485
+ this.EncounterTypes = EncounterTypes;
486
+ this.IssueCount = IssueCount | 0;
487
+ this.Instrument = Instrument;
488
+ this.LastImported = LastImported;
489
+ }
490
+ }
491
+ function TemplateListItem_$reflection() {
492
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.TemplateListItem", [], TemplateListItem, ()=>[
493
+ [
494
+ "TemplateId",
495
+ _Reflection.string_type
496
+ ],
497
+ [
498
+ "TemplateCode",
499
+ _Reflection.string_type
500
+ ],
501
+ [
502
+ "TemplateName",
503
+ _Reflection.string_type
504
+ ],
505
+ [
506
+ "Classification",
507
+ (0, _Reflection.option_type)(_Reflection.string_type)
508
+ ],
509
+ [
510
+ "FieldCount",
511
+ _Reflection.int32_type
512
+ ],
513
+ [
514
+ "TriggerCount",
515
+ _Reflection.int32_type
516
+ ],
517
+ [
518
+ "HasScoring",
519
+ _Reflection.bool_type
520
+ ],
521
+ [
522
+ "HasBlueprintCode",
523
+ _Reflection.bool_type
524
+ ],
525
+ [
526
+ "HasInstrumentMapping",
527
+ _Reflection.bool_type
528
+ ],
529
+ [
530
+ "IsIntake",
531
+ _Reflection.bool_type
532
+ ],
533
+ [
534
+ "EncounterTypes",
535
+ (0, _Reflection.list_type)(_Reflection.string_type)
536
+ ],
537
+ [
538
+ "IssueCount",
539
+ _Reflection.int32_type
540
+ ],
541
+ [
542
+ "Instrument",
543
+ (0, _Reflection.option_type)(_Reflection.string_type)
544
+ ],
545
+ [
546
+ "LastImported",
547
+ (0, _Reflection.option_type)(_Reflection.string_type)
548
+ ]
549
+ ]);
550
+ }
551
+ class ConditionEquivalence extends _Types.Record {
552
+ constructor(CoreEmrCondition, F1Condition, Status){
553
+ super();
554
+ this.CoreEmrCondition = CoreEmrCondition;
555
+ this.F1Condition = F1Condition;
556
+ this.Status = Status;
557
+ }
558
+ }
559
+ function ConditionEquivalence_$reflection() {
560
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.ConditionEquivalence", [], ConditionEquivalence, ()=>[
561
+ [
562
+ "CoreEmrCondition",
563
+ _Reflection.string_type
564
+ ],
565
+ [
566
+ "F1Condition",
567
+ _Reflection.string_type
568
+ ],
569
+ [
570
+ "Status",
571
+ EquivalenceStatus_$reflection()
572
+ ]
573
+ ]);
574
+ }
575
+ class ActionEquivalence extends _Types.Record {
576
+ constructor(CoreEmrAction, F1Action, Status){
577
+ super();
578
+ this.CoreEmrAction = CoreEmrAction;
579
+ this.F1Action = F1Action;
580
+ this.Status = Status;
581
+ }
582
+ }
583
+ function ActionEquivalence_$reflection() {
584
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.ActionEquivalence", [], ActionEquivalence, ()=>[
585
+ [
586
+ "CoreEmrAction",
587
+ _Reflection.string_type
588
+ ],
589
+ [
590
+ "F1Action",
591
+ _Reflection.string_type
592
+ ],
593
+ [
594
+ "Status",
595
+ EquivalenceStatus_$reflection()
596
+ ]
597
+ ]);
598
+ }
599
+ class TriggerMapping extends _Types.Record {
600
+ constructor(TriggerId, Event$, ConditionCount, ActionCount, TransitionName, TransitionFrom, TransitionTo, Status, Conditions, Actions){
601
+ super();
602
+ this.TriggerId = TriggerId | 0;
603
+ this.Event = Event$;
604
+ this.ConditionCount = ConditionCount | 0;
605
+ this.ActionCount = ActionCount | 0;
606
+ this.TransitionName = TransitionName;
607
+ this.TransitionFrom = TransitionFrom;
608
+ this.TransitionTo = TransitionTo;
609
+ this.Status = Status;
610
+ this.Conditions = Conditions;
611
+ this.Actions = Actions;
612
+ }
613
+ }
614
+ function TriggerMapping_$reflection() {
615
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.TriggerMapping", [], TriggerMapping, ()=>[
616
+ [
617
+ "TriggerId",
618
+ _Reflection.int32_type
619
+ ],
620
+ [
621
+ "Event",
622
+ _Reflection.string_type
623
+ ],
624
+ [
625
+ "ConditionCount",
626
+ _Reflection.int32_type
627
+ ],
628
+ [
629
+ "ActionCount",
630
+ _Reflection.int32_type
631
+ ],
632
+ [
633
+ "TransitionName",
634
+ _Reflection.string_type
635
+ ],
636
+ [
637
+ "TransitionFrom",
638
+ _Reflection.string_type
639
+ ],
640
+ [
641
+ "TransitionTo",
642
+ _Reflection.string_type
643
+ ],
644
+ [
645
+ "Status",
646
+ TriggerStatus_$reflection()
647
+ ],
648
+ [
649
+ "Conditions",
650
+ (0, _Reflection.list_type)(ConditionEquivalence_$reflection())
651
+ ],
652
+ [
653
+ "Actions",
654
+ (0, _Reflection.list_type)(ActionEquivalence_$reflection())
655
+ ]
656
+ ]);
657
+ }
658
+ class FieldMapping extends _Types.Record {
659
+ constructor(FieldId, ItemId, Order, Label, F1Type, CoreEmrType, CoreEmrTypeName, ChoiceScores, Code, Required, Options, ScoreSignal, MappingNotes, Status, Triggers){
660
+ super();
661
+ this.FieldId = FieldId;
662
+ this.ItemId = ItemId | 0;
663
+ this.Order = Order | 0;
664
+ this.Label = Label;
665
+ this.F1Type = F1Type;
666
+ this.CoreEmrType = CoreEmrType | 0;
667
+ this.CoreEmrTypeName = CoreEmrTypeName;
668
+ this.ChoiceScores = ChoiceScores;
669
+ this.Code = Code;
670
+ this.Required = Required;
671
+ this.Options = Options | 0;
672
+ this.ScoreSignal = ScoreSignal;
673
+ this.MappingNotes = MappingNotes;
674
+ this.Status = Status;
675
+ this.Triggers = Triggers;
676
+ }
677
+ }
678
+ function FieldMapping_$reflection() {
679
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.FieldMapping", [], FieldMapping, ()=>[
680
+ [
681
+ "FieldId",
682
+ _Reflection.string_type
683
+ ],
684
+ [
685
+ "ItemId",
686
+ _Reflection.int32_type
687
+ ],
688
+ [
689
+ "Order",
690
+ _Reflection.int32_type
691
+ ],
692
+ [
693
+ "Label",
694
+ (0, _Reflection.option_type)(_Reflection.string_type)
695
+ ],
696
+ [
697
+ "F1Type",
698
+ _Reflection.string_type
699
+ ],
700
+ [
701
+ "CoreEmrType",
702
+ _Reflection.int32_type
703
+ ],
704
+ [
705
+ "CoreEmrTypeName",
706
+ _Reflection.string_type
707
+ ],
708
+ [
709
+ "ChoiceScores",
710
+ _Reflection.string_type
711
+ ],
712
+ [
713
+ "Code",
714
+ (0, _Reflection.option_type)(_Reflection.string_type)
715
+ ],
716
+ [
717
+ "Required",
718
+ _Reflection.bool_type
719
+ ],
720
+ [
721
+ "Options",
722
+ _Reflection.int32_type
723
+ ],
724
+ [
725
+ "ScoreSignal",
726
+ _Reflection.string_type
727
+ ],
728
+ [
729
+ "MappingNotes",
730
+ _Reflection.string_type
731
+ ],
732
+ [
733
+ "Status",
734
+ FieldMappingStatus_$reflection()
735
+ ],
736
+ [
737
+ "Triggers",
738
+ (0, _Reflection.list_type)(TriggerMapping_$reflection())
739
+ ]
740
+ ]);
741
+ }
742
+ class StepMapping extends _Types.Record {
743
+ constructor(StepOrder, StepLabel, Fields){
744
+ super();
745
+ this.StepOrder = StepOrder | 0;
746
+ this.StepLabel = StepLabel;
747
+ this.Fields = Fields;
748
+ }
749
+ }
750
+ function StepMapping_$reflection() {
751
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.StepMapping", [], StepMapping, ()=>[
752
+ [
753
+ "StepOrder",
754
+ _Reflection.int32_type
755
+ ],
756
+ [
757
+ "StepLabel",
758
+ (0, _Reflection.option_type)(_Reflection.string_type)
759
+ ],
760
+ [
761
+ "Fields",
762
+ (0, _Reflection.list_type)(FieldMapping_$reflection())
763
+ ]
764
+ ]);
765
+ }
766
+ class TemplateMapping extends _Types.Record {
767
+ constructor(TemplateId, TemplateCode, TemplateName, BlueprintId, BlueprintCode, BlueprintName, Classification, Readiness, Status, TotalFields, ChoiceFields, BitmaskFields, BitmaskCoverage, CodeCoverage, CodedFieldCount, RequiredDensity, RequiredFieldCount, ScoringSignal, InstrumentMapping, BlueprintCodeAvailable, TriggerCount, TriggeredFieldCount, TriggerActionBreakdown, IsIntake, IsScored, EncounterTypes, Usage, HasSignature, StructureHash, FormSpec, FormSpecJson, Steps){
768
+ super();
769
+ this.TemplateId = TemplateId;
770
+ this.TemplateCode = TemplateCode;
771
+ this.TemplateName = TemplateName;
772
+ this.BlueprintId = BlueprintId;
773
+ this.BlueprintCode = BlueprintCode;
774
+ this.BlueprintName = BlueprintName;
775
+ this.Classification = Classification;
776
+ this.Readiness = Readiness;
777
+ this.Status = Status;
778
+ this.TotalFields = TotalFields | 0;
779
+ this.ChoiceFields = ChoiceFields | 0;
780
+ this.BitmaskFields = BitmaskFields | 0;
781
+ this.BitmaskCoverage = BitmaskCoverage;
782
+ this.CodeCoverage = CodeCoverage;
783
+ this.CodedFieldCount = CodedFieldCount | 0;
784
+ this.RequiredDensity = RequiredDensity;
785
+ this.RequiredFieldCount = RequiredFieldCount | 0;
786
+ this.ScoringSignal = ScoringSignal;
787
+ this.InstrumentMapping = InstrumentMapping;
788
+ this.BlueprintCodeAvailable = BlueprintCodeAvailable;
789
+ this.TriggerCount = TriggerCount | 0;
790
+ this.TriggeredFieldCount = TriggeredFieldCount | 0;
791
+ this.TriggerActionBreakdown = TriggerActionBreakdown;
792
+ this.IsIntake = IsIntake;
793
+ this.IsScored = IsScored;
794
+ this.EncounterTypes = EncounterTypes;
795
+ this.Usage = Usage;
796
+ this.HasSignature = HasSignature;
797
+ this.StructureHash = StructureHash;
798
+ this.FormSpec = FormSpec;
799
+ this.FormSpecJson = FormSpecJson;
800
+ this.Steps = Steps;
801
+ }
802
+ }
803
+ function TemplateMapping_$reflection() {
804
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.TemplateMapping", [], TemplateMapping, ()=>[
805
+ [
806
+ "TemplateId",
807
+ _Reflection.string_type
808
+ ],
809
+ [
810
+ "TemplateCode",
811
+ _Reflection.string_type
812
+ ],
813
+ [
814
+ "TemplateName",
815
+ _Reflection.string_type
816
+ ],
817
+ [
818
+ "BlueprintId",
819
+ _Reflection.string_type
820
+ ],
821
+ [
822
+ "BlueprintCode",
823
+ _Reflection.string_type
824
+ ],
825
+ [
826
+ "BlueprintName",
827
+ _Reflection.string_type
828
+ ],
829
+ [
830
+ "Classification",
831
+ (0, _Reflection.option_type)(_Reflection.string_type)
832
+ ],
833
+ [
834
+ "Readiness",
835
+ _Reflection.float64_type
836
+ ],
837
+ [
838
+ "Status",
839
+ TemplateStatus_$reflection()
840
+ ],
841
+ [
842
+ "TotalFields",
843
+ _Reflection.int32_type
844
+ ],
845
+ [
846
+ "ChoiceFields",
847
+ _Reflection.int32_type
848
+ ],
849
+ [
850
+ "BitmaskFields",
851
+ _Reflection.int32_type
852
+ ],
853
+ [
854
+ "BitmaskCoverage",
855
+ _Reflection.float64_type
856
+ ],
857
+ [
858
+ "CodeCoverage",
859
+ _Reflection.float64_type
860
+ ],
861
+ [
862
+ "CodedFieldCount",
863
+ _Reflection.int32_type
864
+ ],
865
+ [
866
+ "RequiredDensity",
867
+ _Reflection.float64_type
868
+ ],
869
+ [
870
+ "RequiredFieldCount",
871
+ _Reflection.int32_type
872
+ ],
873
+ [
874
+ "ScoringSignal",
875
+ _Reflection.float64_type
876
+ ],
877
+ [
878
+ "InstrumentMapping",
879
+ _Reflection.float64_type
880
+ ],
881
+ [
882
+ "BlueprintCodeAvailable",
883
+ _Reflection.bool_type
884
+ ],
885
+ [
886
+ "TriggerCount",
887
+ _Reflection.int32_type
888
+ ],
889
+ [
890
+ "TriggeredFieldCount",
891
+ _Reflection.int32_type
892
+ ],
893
+ [
894
+ "TriggerActionBreakdown",
895
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
896
+ _Reflection.string_type,
897
+ _Reflection.int32_type
898
+ ])
899
+ ],
900
+ [
901
+ "IsIntake",
902
+ _Reflection.bool_type
903
+ ],
904
+ [
905
+ "IsScored",
906
+ _Reflection.bool_type
907
+ ],
908
+ [
909
+ "EncounterTypes",
910
+ (0, _Reflection.list_type)(_Reflection.string_type)
911
+ ],
912
+ [
913
+ "Usage",
914
+ (0, _Reflection.option_type)(_Reflection.string_type)
915
+ ],
916
+ [
917
+ "HasSignature",
918
+ _Reflection.bool_type
919
+ ],
920
+ [
921
+ "StructureHash",
922
+ _Reflection.string_type
923
+ ],
924
+ [
925
+ "FormSpec",
926
+ (0, _FormSpec.Spec_FormSpec$1_$reflection)((0, _FormSpec.Spec_FieldType_$reflection)())
927
+ ],
928
+ [
929
+ "FormSpecJson",
930
+ _Reflection.string_type
931
+ ],
932
+ [
933
+ "Steps",
934
+ (0, _Reflection.list_type)(StepMapping_$reflection())
935
+ ]
936
+ ]);
937
+ }
938
+ class FormDetail extends _Types.Record {
939
+ constructor(FormId, FormCode, FormName){
940
+ super();
941
+ this.FormId = FormId | 0;
942
+ this.FormCode = FormCode;
943
+ this.FormName = FormName;
944
+ }
945
+ }
946
+ function FormDetail_$reflection() {
947
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.FormDetail", [], FormDetail, ()=>[
948
+ [
949
+ "FormId",
950
+ _Reflection.int32_type
951
+ ],
952
+ [
953
+ "FormCode",
954
+ _Reflection.string_type
955
+ ],
956
+ [
957
+ "FormName",
958
+ _Reflection.string_type
959
+ ]
960
+ ]);
961
+ }
962
+ class TriggerFormStat extends _Types.Record {
963
+ constructor(FormId, FormCode, FormName, TriggerCount){
964
+ super();
965
+ this.FormId = FormId | 0;
966
+ this.FormCode = FormCode;
967
+ this.FormName = FormName;
968
+ this.TriggerCount = TriggerCount | 0;
969
+ }
970
+ }
971
+ function TriggerFormStat_$reflection() {
972
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.TriggerFormStat", [], TriggerFormStat, ()=>[
973
+ [
974
+ "FormId",
975
+ _Reflection.int32_type
976
+ ],
977
+ [
978
+ "FormCode",
979
+ _Reflection.string_type
980
+ ],
981
+ [
982
+ "FormName",
983
+ _Reflection.string_type
984
+ ],
985
+ [
986
+ "TriggerCount",
987
+ _Reflection.int32_type
988
+ ]
989
+ ]);
990
+ }
991
+ class ActionFormDetail extends _Types.Record {
992
+ constructor(FormId, FormCode, FormName, Count){
993
+ super();
994
+ this.FormId = FormId | 0;
995
+ this.FormCode = FormCode;
996
+ this.FormName = FormName;
997
+ this.Count = Count | 0;
998
+ }
999
+ }
1000
+ function ActionFormDetail_$reflection() {
1001
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.ActionFormDetail", [], ActionFormDetail, ()=>[
1002
+ [
1003
+ "FormId",
1004
+ _Reflection.int32_type
1005
+ ],
1006
+ [
1007
+ "FormCode",
1008
+ _Reflection.string_type
1009
+ ],
1010
+ [
1011
+ "FormName",
1012
+ _Reflection.string_type
1013
+ ],
1014
+ [
1015
+ "Count",
1016
+ _Reflection.int32_type
1017
+ ]
1018
+ ]);
1019
+ }
1020
+ class InstrumentDetail extends _Types.Record {
1021
+ constructor(FormId, FormCode, FormName, InstrumentType, MaxScore, Source, Archived){
1022
+ super();
1023
+ this.FormId = FormId | 0;
1024
+ this.FormCode = FormCode;
1025
+ this.FormName = FormName;
1026
+ this.InstrumentType = InstrumentType;
1027
+ this.MaxScore = MaxScore;
1028
+ this.Source = Source;
1029
+ this.Archived = Archived;
1030
+ }
1031
+ }
1032
+ function InstrumentDetail_$reflection() {
1033
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.InstrumentDetail", [], InstrumentDetail, ()=>[
1034
+ [
1035
+ "FormId",
1036
+ _Reflection.int32_type
1037
+ ],
1038
+ [
1039
+ "FormCode",
1040
+ _Reflection.string_type
1041
+ ],
1042
+ [
1043
+ "FormName",
1044
+ _Reflection.string_type
1045
+ ],
1046
+ [
1047
+ "InstrumentType",
1048
+ _Reflection.string_type
1049
+ ],
1050
+ [
1051
+ "MaxScore",
1052
+ (0, _Reflection.option_type)(_Reflection.int32_type)
1053
+ ],
1054
+ [
1055
+ "Source",
1056
+ _Reflection.string_type
1057
+ ],
1058
+ [
1059
+ "Archived",
1060
+ _Reflection.bool_type
1061
+ ]
1062
+ ]);
1063
+ }
1064
+ class ManifestStats extends _Types.Record {
1065
+ constructor(TotalForms, TotalFields, TotalTriggers, FormsWithTriggers, FormsWithScoring, FormsWithSignature, FormsIntake, EncMedical, EncMental, EncDental, EncOther, EncounterFormMap, PropertyFormMap, TopFormsByTriggers, ActionTypeBreakdown, ActionTypeFormMap, EventTypeBreakdown, EventTypeFormMap, ExclusiveTagForms, InstrumentTotal, InstrumentCurrent, InstrumentArchived, InstrumentByType, InstrumentBySource, InstrumentDetails, InstrumentTypeDetails, InstrumentSourceDetails, AppVersion, SchemaVersion, SchemaRevision, WithCodes, WithSyntheticCodes){
1066
+ super();
1067
+ this.TotalForms = TotalForms | 0;
1068
+ this.TotalFields = TotalFields | 0;
1069
+ this.TotalTriggers = TotalTriggers | 0;
1070
+ this.FormsWithTriggers = FormsWithTriggers | 0;
1071
+ this.FormsWithScoring = FormsWithScoring | 0;
1072
+ this.FormsWithSignature = FormsWithSignature | 0;
1073
+ this.FormsIntake = FormsIntake | 0;
1074
+ this.EncMedical = EncMedical | 0;
1075
+ this.EncMental = EncMental | 0;
1076
+ this.EncDental = EncDental | 0;
1077
+ this.EncOther = EncOther | 0;
1078
+ this.EncounterFormMap = EncounterFormMap;
1079
+ this.PropertyFormMap = PropertyFormMap;
1080
+ this.TopFormsByTriggers = TopFormsByTriggers;
1081
+ this.ActionTypeBreakdown = ActionTypeBreakdown;
1082
+ this.ActionTypeFormMap = ActionTypeFormMap;
1083
+ this.EventTypeBreakdown = EventTypeBreakdown;
1084
+ this.EventTypeFormMap = EventTypeFormMap;
1085
+ this.ExclusiveTagForms = ExclusiveTagForms | 0;
1086
+ this.InstrumentTotal = InstrumentTotal | 0;
1087
+ this.InstrumentCurrent = InstrumentCurrent | 0;
1088
+ this.InstrumentArchived = InstrumentArchived | 0;
1089
+ this.InstrumentByType = InstrumentByType;
1090
+ this.InstrumentBySource = InstrumentBySource;
1091
+ this.InstrumentDetails = InstrumentDetails;
1092
+ this.InstrumentTypeDetails = InstrumentTypeDetails;
1093
+ this.InstrumentSourceDetails = InstrumentSourceDetails;
1094
+ this.AppVersion = AppVersion;
1095
+ this.SchemaVersion = SchemaVersion;
1096
+ this.SchemaRevision = SchemaRevision | 0;
1097
+ this.WithCodes = WithCodes | 0;
1098
+ this.WithSyntheticCodes = WithSyntheticCodes | 0;
1099
+ }
1100
+ }
1101
+ function ManifestStats_$reflection() {
1102
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.ManifestStats", [], ManifestStats, ()=>[
1103
+ [
1104
+ "TotalForms",
1105
+ _Reflection.int32_type
1106
+ ],
1107
+ [
1108
+ "TotalFields",
1109
+ _Reflection.int32_type
1110
+ ],
1111
+ [
1112
+ "TotalTriggers",
1113
+ _Reflection.int32_type
1114
+ ],
1115
+ [
1116
+ "FormsWithTriggers",
1117
+ _Reflection.int32_type
1118
+ ],
1119
+ [
1120
+ "FormsWithScoring",
1121
+ _Reflection.int32_type
1122
+ ],
1123
+ [
1124
+ "FormsWithSignature",
1125
+ _Reflection.int32_type
1126
+ ],
1127
+ [
1128
+ "FormsIntake",
1129
+ _Reflection.int32_type
1130
+ ],
1131
+ [
1132
+ "EncMedical",
1133
+ _Reflection.int32_type
1134
+ ],
1135
+ [
1136
+ "EncMental",
1137
+ _Reflection.int32_type
1138
+ ],
1139
+ [
1140
+ "EncDental",
1141
+ _Reflection.int32_type
1142
+ ],
1143
+ [
1144
+ "EncOther",
1145
+ _Reflection.int32_type
1146
+ ],
1147
+ [
1148
+ "EncounterFormMap",
1149
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1150
+ _Reflection.string_type,
1151
+ (0, _Reflection.list_type)(FormDetail_$reflection())
1152
+ ])
1153
+ ],
1154
+ [
1155
+ "PropertyFormMap",
1156
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1157
+ _Reflection.string_type,
1158
+ (0, _Reflection.list_type)(FormDetail_$reflection())
1159
+ ])
1160
+ ],
1161
+ [
1162
+ "TopFormsByTriggers",
1163
+ (0, _Reflection.list_type)(TriggerFormStat_$reflection())
1164
+ ],
1165
+ [
1166
+ "ActionTypeBreakdown",
1167
+ (0, _Reflection.list_type)((0, _Reflection.tuple_type)(_Reflection.string_type, _Reflection.int32_type))
1168
+ ],
1169
+ [
1170
+ "ActionTypeFormMap",
1171
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1172
+ _Reflection.string_type,
1173
+ (0, _Reflection.list_type)(ActionFormDetail_$reflection())
1174
+ ])
1175
+ ],
1176
+ [
1177
+ "EventTypeBreakdown",
1178
+ (0, _Reflection.list_type)((0, _Reflection.tuple_type)(_Reflection.string_type, _Reflection.int32_type))
1179
+ ],
1180
+ [
1181
+ "EventTypeFormMap",
1182
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1183
+ _Reflection.string_type,
1184
+ (0, _Reflection.list_type)(FormDetail_$reflection())
1185
+ ])
1186
+ ],
1187
+ [
1188
+ "ExclusiveTagForms",
1189
+ _Reflection.int32_type
1190
+ ],
1191
+ [
1192
+ "InstrumentTotal",
1193
+ _Reflection.int32_type
1194
+ ],
1195
+ [
1196
+ "InstrumentCurrent",
1197
+ _Reflection.int32_type
1198
+ ],
1199
+ [
1200
+ "InstrumentArchived",
1201
+ _Reflection.int32_type
1202
+ ],
1203
+ [
1204
+ "InstrumentByType",
1205
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1206
+ _Reflection.string_type,
1207
+ _Reflection.int32_type
1208
+ ])
1209
+ ],
1210
+ [
1211
+ "InstrumentBySource",
1212
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1213
+ _Reflection.string_type,
1214
+ _Reflection.int32_type
1215
+ ])
1216
+ ],
1217
+ [
1218
+ "InstrumentDetails",
1219
+ (0, _Reflection.list_type)(InstrumentDetail_$reflection())
1220
+ ],
1221
+ [
1222
+ "InstrumentTypeDetails",
1223
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1224
+ _Reflection.string_type,
1225
+ (0, _Reflection.list_type)(InstrumentDetail_$reflection())
1226
+ ])
1227
+ ],
1228
+ [
1229
+ "InstrumentSourceDetails",
1230
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1231
+ _Reflection.string_type,
1232
+ (0, _Reflection.list_type)(InstrumentDetail_$reflection())
1233
+ ])
1234
+ ],
1235
+ [
1236
+ "AppVersion",
1237
+ _Reflection.string_type
1238
+ ],
1239
+ [
1240
+ "SchemaVersion",
1241
+ _Reflection.string_type
1242
+ ],
1243
+ [
1244
+ "SchemaRevision",
1245
+ _Reflection.int32_type
1246
+ ],
1247
+ [
1248
+ "WithCodes",
1249
+ _Reflection.int32_type
1250
+ ],
1251
+ [
1252
+ "WithSyntheticCodes",
1253
+ _Reflection.int32_type
1254
+ ]
1255
+ ]);
1256
+ }
1257
+ function computeStats(m) {
1258
+ let matchValue;
1259
+ const forms = (0, _List.map)((tuple)=>tuple[1], (0, _Map.toList)(m.Forms));
1260
+ const toDetail = (f)=>new FormDetail(f.FormId, f.FormCode, f.Name);
1261
+ const allItems = (0, _List.collect)((f_1)=>f_1.Items, forms);
1262
+ const allTriggers = (0, _List.collect)((i)=>(0, _FormTemplateDecoder.ReleaseAvailability_readList)(i.Triggers), allItems);
1263
+ const formsWithTriggerCounts = (0, _List.sortByDescending)((f_4)=>f_4.TriggerCount, (0, _List.filter)((f_3)=>f_3.TriggerCount > 0, (0, _List.map)((f_2)=>new TriggerFormStat(f_2.FormId, f_2.FormCode, f_2.Name, (0, _List.sumBy)((i_1)=>(0, _List.length)((0, _FormTemplateDecoder.ReleaseAvailability_readList)(i_1.Triggers)), f_2.Items, {
1264
+ GetZero: ()=>0,
1265
+ Add: (x, y)=>x + y
1266
+ })), forms)), {
1267
+ Compare: _Util.comparePrimitives
1268
+ });
1269
+ const actionBreakdown = (0, _List.sortByDescending)((tuple_1)=>tuple_1[1], (0, _Seq2.List_countBy)((x_2)=>x_2, (0, _List.map)((a)=>a.ActionType, (0, _List.collect)((t)=>t.Actions, allTriggers)), {
1270
+ Equals: (x_3, y_2)=>x_3 === y_2,
1271
+ GetHashCode: _Util.stringHash
1272
+ }), {
1273
+ Compare: _Util.comparePrimitives
1274
+ });
1275
+ const actionTypeFormMap = (0, _Map.ofList)((0, _List.map)((tupledArg_1)=>[
1276
+ tupledArg_1[0],
1277
+ (0, _List.sortByDescending)((d)=>d.Count, (0, _List.map)((tupledArg_3)=>{
1278
+ const _arg_4 = tupledArg_3[0];
1279
+ return new ActionFormDetail(_arg_4[0], _arg_4[1], _arg_4[2], tupledArg_3[1]);
1280
+ }, (0, _Seq2.List_countBy)((x_6)=>x_6, (0, _List.map)((tupledArg_2)=>[
1281
+ tupledArg_2[1],
1282
+ tupledArg_2[2],
1283
+ tupledArg_2[3]
1284
+ ], tupledArg_1[1]), {
1285
+ Equals: _Util.equalArrays,
1286
+ GetHashCode: _Util.arrayHash
1287
+ })), {
1288
+ Compare: _Util.comparePrimitives
1289
+ })
1290
+ ], (0, _Seq2.List_groupBy)((tupledArg)=>tupledArg[0], (0, _List.collect)((f_5)=>(0, _List.collect)((i_2)=>(0, _List.collect)((t_1)=>(0, _List.map)((a_1)=>[
1291
+ a_1.ActionType,
1292
+ f_5.FormId,
1293
+ f_5.FormCode,
1294
+ f_5.Name
1295
+ ], t_1.Actions), (0, _FormTemplateDecoder.ReleaseAvailability_readList)(i_2.Triggers)), f_5.Items), forms), {
1296
+ Equals: (x_5, y_4)=>x_5 === y_4,
1297
+ GetHashCode: _Util.stringHash
1298
+ })), {
1299
+ Compare: _Util.comparePrimitives
1300
+ });
1301
+ const eventBreakdown = (0, _List.sortByDescending)((tuple_2)=>tuple_2[1], (0, _Seq2.List_countBy)((x_10)=>x_10, (0, _List.map)((t_2)=>t_2.EventName, allTriggers), {
1302
+ Equals: (x_11, y_8)=>x_11 === y_8,
1303
+ GetHashCode: _Util.stringHash
1304
+ }), {
1305
+ Compare: _Util.comparePrimitives
1306
+ });
1307
+ const eventTypeFormMap = (0, _Map.ofList)((0, _List.map)((tupledArg_4)=>[
1308
+ tupledArg_4[0],
1309
+ (0, _List.sortBy)((d_1)=>d_1.FormName, (0, _List.map)(toDetail, (0, _Seq2.List_distinctBy)((f_7)=>f_7.FormId, (0, _List.map)((tuple_4)=>tuple_4[1], tupledArg_4[1]), {
1310
+ Equals: (x_14, y_11)=>x_14 === y_11,
1311
+ GetHashCode: _Util.numberHash
1312
+ })), {
1313
+ Compare: _Util.comparePrimitives
1314
+ })
1315
+ ], (0, _Seq2.List_groupBy)((tuple_3)=>tuple_3[0], (0, _List.collect)((f_6)=>(0, _List.collect)((i_3)=>(0, _List.map)((t_3)=>[
1316
+ t_3.EventName,
1317
+ f_6
1318
+ ], (0, _FormTemplateDecoder.ReleaseAvailability_readList)(i_3.Triggers)), f_6.Items), forms), {
1319
+ Equals: (x_13, y_10)=>x_13 === y_10,
1320
+ GetHashCode: _Util.stringHash
1321
+ })), {
1322
+ Compare: _Util.comparePrimitives
1323
+ });
1324
+ const exclusiveTagForms = (0, _List.length)((0, _List.filter)((f_8)=>(0, _List.exists)((i_4)=>(0, _List.exists)((t_4)=>t_4.ExclusiveTag != null, (0, _FormTemplateDecoder.ReleaseAvailability_readList)(i_4.Triggers)), f_8.Items), forms)) | 0;
1325
+ const encounterFormMap = (0, _Map.ofList)((0, _List.ofArray)([
1326
+ [
1327
+ "Medical",
1328
+ (0, _List.map)(toDetail, (0, _List.filter)((f_9)=>f_9.EncounterTypes.Medical, forms))
1329
+ ],
1330
+ [
1331
+ "Mental",
1332
+ (0, _List.map)(toDetail, (0, _List.filter)((f_10)=>f_10.EncounterTypes.Mental, forms))
1333
+ ],
1334
+ [
1335
+ "Dental",
1336
+ (0, _List.map)(toDetail, (0, _List.filter)((f_11)=>f_11.EncounterTypes.Dental, forms))
1337
+ ],
1338
+ [
1339
+ "Other",
1340
+ (0, _List.map)(toDetail, (0, _List.filter)((f_12)=>(0, _FormTemplateDecoder.ReleaseAvailability_statedTrue)(f_12.EncounterTypes.Other), forms))
1341
+ ]
1342
+ ]), {
1343
+ Compare: _Util.comparePrimitives
1344
+ });
1345
+ const formsWithTriggerDetails = (0, _List.map)(toDetail, (0, _List.filter)((f_13)=>(0, _List.exists)((i_5)=>!(0, _List.isEmpty)((0, _FormTemplateDecoder.ReleaseAvailability_readList)(i_5.Triggers)), f_13.Items), forms));
1346
+ const propertyFormMap = (0, _Map.ofList)((0, _List.ofArray)([
1347
+ [
1348
+ "WithCodes",
1349
+ (0, _List.map)(toDetail, (0, _List.filter)((f_14)=>f_14.FormCodeSource !== "generated", forms))
1350
+ ],
1351
+ [
1352
+ "WithTriggers",
1353
+ formsWithTriggerDetails
1354
+ ],
1355
+ [
1356
+ "WithScoring",
1357
+ (0, _List.map)(toDetail, (0, _List.filter)((f_15)=>f_15.Scoring != null, forms))
1358
+ ],
1359
+ [
1360
+ "Intake",
1361
+ (0, _List.map)(toDetail, (0, _List.filter)((f_16)=>f_16.IsIntake, forms))
1362
+ ],
1363
+ [
1364
+ "RequireSignature",
1365
+ (0, _List.map)(toDetail, (0, _List.filter)((f_17)=>f_17.RequiresSignature, forms))
1366
+ ]
1367
+ ]), {
1368
+ Compare: _Util.comparePrimitives
1369
+ });
1370
+ const formsByCode = new Map((0, _List.map)((f_18)=>[
1371
+ f_18.FormCode,
1372
+ f_18
1373
+ ], forms));
1374
+ let allInstrumentDetails;
1375
+ try {
1376
+ allInstrumentDetails = (0, _List.choose)((e)=>{
1377
+ let matchValue_1;
1378
+ let outArg = (0, _Util.defaultOf)();
1379
+ matchValue_1 = [
1380
+ (0, _MapUtil.tryGetValue)(formsByCode, e.FormCode, new _Types.FSharpRef(()=>outArg, (v)=>{
1381
+ outArg = v;
1382
+ })),
1383
+ outArg
1384
+ ];
1385
+ if (matchValue_1[0]) {
1386
+ return new InstrumentDetail(matchValue_1[1].FormId, e.FormCode, e.FormName, e.InstrumentType, e.MaxScore, e.Source, e.Archived);
1387
+ } else {
1388
+ return undefined;
1389
+ }
1390
+ }, (0, _List.map)((tuple_5)=>tuple_5[1], (0, _Map.toList)((matchValue = m.Scoring, matchValue.tag === /* NotInRelease */ 1 ? (0, _Map.empty)({
1391
+ Compare: _Util.comparePrimitives
1392
+ }) : matchValue.tag === /* NotReadYet */ 2 ? (0, _Map.empty)({
1393
+ Compare: _Util.comparePrimitives
1394
+ }) : matchValue.fields[0].InstrumentMap))));
1395
+ } catch (matchValue_2) {
1396
+ allInstrumentDetails = (0, _List.empty)();
1397
+ }
1398
+ const instrumentTypeDetails = (0, _Map.ofList)((0, _Seq2.List_groupBy)((d_2)=>d_2.InstrumentType, allInstrumentDetails, {
1399
+ Equals: (x_20, y_17)=>x_20 === y_17,
1400
+ GetHashCode: _Util.stringHash
1401
+ }), {
1402
+ Compare: _Util.comparePrimitives
1403
+ });
1404
+ const instrumentSourceDetails = (0, _Map.ofList)((0, _Seq2.List_groupBy)((d_3)=>d_3.Source, allInstrumentDetails, {
1405
+ Equals: (x_22, y_19)=>x_22 === y_19,
1406
+ GetHashCode: _Util.stringHash
1407
+ }), {
1408
+ Compare: _Util.comparePrimitives
1409
+ });
1410
+ return new ManifestStats((0, _List.length)(forms), (0, _List.length)(allItems), (0, _List.length)(allTriggers), (0, _List.length)(formsWithTriggerCounts), (0, _List.length)((0, _List.filter)((f_20)=>f_20.Scoring != null, forms)), (0, _List.length)((0, _List.filter)((f_21)=>f_21.RequiresSignature, forms)), (0, _List.length)((0, _List.filter)((f_22)=>f_22.IsIntake, forms)), (0, _List.length)((0, _List.filter)((f_23)=>f_23.EncounterTypes.Medical, forms)), (0, _List.length)((0, _List.filter)((f_24)=>f_24.EncounterTypes.Mental, forms)), (0, _List.length)((0, _List.filter)((f_25)=>f_25.EncounterTypes.Dental, forms)), (0, _List.length)((0, _List.filter)((f_26)=>(0, _FormTemplateDecoder.ReleaseAvailability_statedTrue)(f_26.EncounterTypes.Other), forms)), encounterFormMap, propertyFormMap, (0, _List.truncate)(15, formsWithTriggerCounts), actionBreakdown, actionTypeFormMap, eventBreakdown, eventTypeFormMap, exclusiveTagForms, (0, _List.length)(allInstrumentDetails), (0, _List.length)((0, _List.filter)((d_4)=>!d_4.Archived, allInstrumentDetails)), (0, _List.length)((0, _List.filter)((d_5)=>d_5.Archived, allInstrumentDetails)), (0, _Map.ofList)((0, _Seq2.List_countBy)((d_6)=>d_6.InstrumentType, allInstrumentDetails, {
1411
+ Equals: (x_24, y_21)=>x_24 === y_21,
1412
+ GetHashCode: _Util.stringHash
1413
+ }), {
1414
+ Compare: _Util.comparePrimitives
1415
+ }), (0, _Map.ofList)((0, _Seq2.List_countBy)((d_7)=>d_7.Source, allInstrumentDetails, {
1416
+ Equals: (x_26, y_23)=>x_26 === y_23,
1417
+ GetHashCode: _Util.stringHash
1418
+ }), {
1419
+ Compare: _Util.comparePrimitives
1420
+ }), allInstrumentDetails, instrumentTypeDetails, instrumentSourceDetails, m.CoreEmr.AppVersion, m.CoreEmr.SchemaVersion, m.CoreEmr.SchemaRevision, m.Stats.WithCodes, m.Stats.WithSyntheticCodes);
1421
+ }
1422
+ function toManifest(m) {
1423
+ let matchValue, matchValue_1, matchValue_2, matchValue_3, matchValue_4, matchValue_5;
1424
+ return new Manifest(m.GeneratedFrom, m.GeneratedAt, (0, _Util.int32ToString)(m.Version), m.CoreEmr.AppVersion, m.CoreEmr.SchemaVersion, (0, _Util.int32ToString)(m.CoreEmr.SchemaRevision), m.Stats.TotalForms, m.Stats.WithCodes, (matchValue = m.Scoring, matchValue.tag === /* Stated */ 0 ? matchValue.fields[0].FormsWithScoring : 0), (matchValue_1 = m.Scoring, matchValue_1.tag === /* Stated */ 0 ? matchValue_1.fields[0].InstrumentMapStats.Total : 0), (matchValue_2 = m.Scoring, matchValue_2.tag === /* Stated */ 0 ? matchValue_2.fields[0].InstrumentMapStats.Current : 0), (matchValue_3 = m.Scoring, matchValue_3.tag === /* Stated */ 0 ? matchValue_3.fields[0].InstrumentMapStats.Archived : 0), (matchValue_4 = m.Scoring, matchValue_4.tag === /* Stated */ 0 ? undefined : (0, _FormTemplateDecoder.ReleaseAvailability_describe)(matchValue_4)), (matchValue_5 = m.Triggers, matchValue_5.tag === /* Stated */ 0 ? undefined : (0, _FormTemplateDecoder.ReleaseAvailability_describe)(matchValue_5)));
1425
+ }
1426
+ function toTemplateListFromMappings(m, mappings) {
1427
+ return (0, _List.map)((tupledArg_1)=>{
1428
+ const form = tupledArg_1[1];
1429
+ const mappingResult = (0, _Map.tryFind)(tupledArg_1[0], mappings);
1430
+ let matchResult, mapping;
1431
+ if (mappingResult != null) {
1432
+ const copyOfStruct = (0, _Option.value)(mappingResult);
1433
+ if (copyOfStruct.tag === /* Ok */ 0) {
1434
+ matchResult = 0;
1435
+ mapping = copyOfStruct.fields[0];
1436
+ } else {
1437
+ matchResult = 1;
1438
+ }
1439
+ } else {
1440
+ matchResult = 1;
1441
+ }
1442
+ switch(matchResult){
1443
+ case 0:
1444
+ {
1445
+ const issueCount = (0, _List.length)((0, _List.filter)((f_1)=>(0, _Util.equals)(f_1.Status, FieldMappingStatus_Unsupported()), (0, _List.collect)((s)=>s.Fields, mapping.Steps))) | 0;
1446
+ return new TemplateListItem((0, _Util.int32ToString)(form.FormId), form.FormCode, form.Name, form.Usage, mapping.TotalFields, mapping.TriggerCount, mapping.IsScored, mapping.BlueprintCodeAvailable, mapping.InstrumentMapping > 0, mapping.IsIntake, mapping.EncounterTypes, issueCount, (0, _Option.map)((e_1)=>e_1.InstrumentType, (0, _List.tryFind)((e)=>{
1447
+ if ((0, _String.compare)(e.FormCode, form.FormCode, 5) === 0) {
1448
+ return !e.Archived;
1449
+ } else {
1450
+ return false;
1451
+ }
1452
+ }, (0, _List.map)((tuple)=>tuple[1], (0, _Map.toList)(instrumentsOf(m))))), undefined);
1453
+ }
1454
+ default:
1455
+ {
1456
+ const triggerCount = (0, _List.sumBy)((i)=>(0, _List.length)((0, _FormTemplateDecoder.ReleaseAvailability_readList)(i.Triggers)), form.Items, {
1457
+ GetZero: ()=>0,
1458
+ Add: (x_1, y_1)=>x_1 + y_1
1459
+ }) | 0;
1460
+ return new TemplateListItem((0, _Util.int32ToString)(form.FormId), form.FormCode, form.Name, form.Usage, (0, _List.length)(form.Items), triggerCount, form.Scoring != null, form.FormCode.length > 0 && !(form.FormCode.indexOf("#") >= 0), false, form.IsIntake, (0, _List.empty)(), 0, undefined, undefined);
1461
+ }
1462
+ }
1463
+ }, (0, _List.sortBy)((tupledArg)=>tupledArg[1].Name.toLowerCase(), (0, _Map.toList)(m.Forms), {
1464
+ Compare: _Util.comparePrimitives
1465
+ }));
1466
+ }
1467
+ function describeActionInfo(ai) {
1468
+ switch(ai.tag){
1469
+ case /* Alert */ 9:
1470
+ return `Alert: ${ai.fields[0].Category}`;
1471
+ case /* Task */ 8:
1472
+ return `Task: ${ai.fields[0].Category}`;
1473
+ case /* Medication */ 0:
1474
+ return `Medication: ${ai.fields[0].Name}`;
1475
+ case /* Treatment */ 1:
1476
+ return `Treatment: ${(0, _Option.defaultArg)(ai.fields[0].Name, "")}`;
1477
+ case /* Medset */ 2:
1478
+ return `Medset: ${ai.fields[0].Name}`;
1479
+ case /* Problem */ 10:
1480
+ return `Problem: ${(0, _Option.defaultArg)(ai.fields[0].ProblemName, "")}`;
1481
+ case /* Documentation */ 7:
1482
+ return `Doc: ${ai.fields[0].Purpose}`;
1483
+ case /* Prescription */ 11:
1484
+ return `Rx: ${ai.fields[0].Medication}`;
1485
+ case /* ChangeGroups */ 14:
1486
+ return `Groups: ${(0, _List.length)(ai.fields[0].Groups)}`;
1487
+ default:
1488
+ return "Action";
1489
+ }
1490
+ }
1491
+ function describeCondition(tc) {
1492
+ switch(tc.tag){
1493
+ case /* FieldCondition */ 0:
1494
+ {
1495
+ const evaluator = tc.fields[1];
1496
+ const condValue = tc.fields[2];
1497
+ return `field ${evaluator.tag === /* InSet */ 2 ? `in [${(0, _String.join)(", ", evaluator.fields[0])}]` : evaluator.tag === /* Equals */ 0 ? "equals" : evaluator.tag === /* NotEquals */ 1 ? "not equals" : evaluator.tag === /* GreaterOrEqual */ 6 ? ">=" : evaluator.tag === /* GreaterThan */ 5 ? ">" : evaluator.tag === /* LessOrEqual */ 8 ? "<=" : evaluator.tag === /* LessThan */ 7 ? "<" : "?"} ${condValue.tag === /* Single */ 0 ? condValue.fields[0] : condValue.tag === /* Multiple */ 1 ? (0, _String.join)(", ", (0, _Set.toList)(condValue.fields[0])) : "..."}`;
1498
+ }
1499
+ case /* CompositeCondition */ 6:
1500
+ {
1501
+ const op = tc.fields[0];
1502
+ const condList = tc.fields[1];
1503
+ const opStr = op.tag === /* And */ 0 ? "AND" : op.tag === /* Or */ 1 ? "OR" : "?";
1504
+ return `${(0, _List.length)(condList)} conditions (${opStr})`;
1505
+ }
1506
+ case /* Always */ 8:
1507
+ return "always";
1508
+ default:
1509
+ return "condition";
1510
+ }
1511
+ }
1512
+ function toTriggerMapping(items, readsById, trigger, itemFieldKeyMap) {
1513
+ const read = (0, _Map.find)(trigger.TriggerId, readsById);
1514
+ const conditions = (0, _List.map)((tupledArg)=>{
1515
+ const c = tupledArg[0];
1516
+ let condText;
1517
+ const matchValue = c.Values;
1518
+ condText = (0, _List.isEmpty)(matchValue) ? `${c.Source} ${c.Operator}` : `${c.Source} ${c.Operator} [${(0, _String.join)(", ", matchValue)}]`;
1519
+ try {
1520
+ return new ConditionEquivalence(condText, describeCondition((0, _CoreMRPathwayMapper.convertCondition)(items, tupledArg[1], itemFieldKeyMap)), EquivalenceStatus_EquivEquivalent());
1521
+ } catch (matchValue_1) {
1522
+ return new ConditionEquivalence(condText, "unsupported", EquivalenceStatus_EquivMissing());
1523
+ }
1524
+ }, (0, _List.zip)(trigger.Conditions, read.Conditions));
1525
+ const actions = (0, _List.map)((a)=>{
1526
+ const name = (0, _Option.defaultArg)((0, _Option.orElse)((0, _Map.tryFind)("category_name", a.Params), (0, _Map.tryFind)("medset_name", a.Params)), "");
1527
+ const actionText = (0, _String.isNullOrEmpty)(name) ? a.ActionType : `${a.ActionType}: ${name}`;
1528
+ let patternInput;
1529
+ const matchValue_2 = (0, _List.find)((r)=>r.ActionId === a.ActionId, read.Actions).Read;
1530
+ patternInput = matchValue_2.tag === /* Unmodelled */ 1 ? [
1531
+ `Not modelled: ${matchValue_2.fields[1]}`,
1532
+ EquivalenceStatus_EquivMismatch()
1533
+ ] : [
1534
+ describeActionInfo((0, _CoreMRPathwayMapper.convertAction)(matchValue_2.fields[0])),
1535
+ EquivalenceStatus_EquivEquivalent()
1536
+ ];
1537
+ return new ActionEquivalence(actionText, patternInput[0], patternInput[1]);
1538
+ }, trigger.Actions);
1539
+ const firstAction = (0, _List.tryHead)(trigger.Actions);
1540
+ const allStatuses = (0, _List.append)((0, _List.map)((c_1)=>c_1.Status, conditions), (0, _List.map)((a_1)=>a_1.Status, actions));
1541
+ const triggerStatus = !trigger.Enabled ? TriggerStatus_Pending() : (0, _List.exists)((s)=>(0, _Util.equals)(s, EquivalenceStatus_EquivMissing()), allStatuses) ? TriggerStatus_Failed() : (0, _List.exists)((s_1)=>(0, _Util.equals)(s_1, EquivalenceStatus_EquivMismatch()), allStatuses) ? TriggerStatus_Partial() : TriggerStatus_Equivalent();
1542
+ return new TriggerMapping(trigger.TriggerId, trigger.EventName, (0, _List.length)(trigger.Conditions), (0, _List.length)(trigger.Actions), (0, _Option.defaultArg)((0, _Option.map)((a_2)=>a_2.ActionType, firstAction), "unknown"), "current", (0, _Option.defaultArg)((0, _Option.bind)((a_3)=>(0, _Map.tryFind)("category_name", a_3.Params), firstAction), "action"), triggerStatus, conditions, actions);
1543
+ }
1544
+ function getFieldTypeName(fieldType) {
1545
+ return (0, _Reflection.name)((0, _Reflection.getUnionFields)(fieldType, (0, _FormSpec.Spec_FieldType_$reflection)())[0]);
1546
+ }
1547
+ function getF1TypeDisplay(typeCode) {
1548
+ const info = (0, _CorEMRElementTypeMap.getElementTypeInfo)(typeCode);
1549
+ const matchValue = info.Code;
1550
+ switch(matchValue){
1551
+ case "text":
1552
+ return "Text";
1553
+ case "text_multiline":
1554
+ return "TextArea";
1555
+ case "dropdown":
1556
+ return "Dropdown";
1557
+ case "dropdown_notes":
1558
+ return "Dropdown + Notes";
1559
+ case "dropdown_notes_ui":
1560
+ return "Dropdown";
1561
+ case "chips_notes":
1562
+ return "Multi-Select + Notes";
1563
+ case "chips_ros":
1564
+ return "Multi-Select";
1565
+ case "yes_no_text":
1566
+ return "Radio";
1567
+ case "yes_no_notes":
1568
+ return "Radio + Notes";
1569
+ case "exam_3choice":
1570
+ return "Radio";
1571
+ case "checkbox":
1572
+ return "Checkbox";
1573
+ case "checkbox_notes":
1574
+ return "Checkbox + Notes";
1575
+ case "date":
1576
+ return "Date";
1577
+ case "datetime":
1578
+ return "DateTime";
1579
+ case "signature_date":
1580
+ return "Signature + Date";
1581
+ case "signature":
1582
+ return "Signature";
1583
+ case "heading":
1584
+ case "instructions":
1585
+ case "group_row":
1586
+ case "sub_header":
1587
+ return "Message";
1588
+ case "vitals_widget":
1589
+ return "PluginField";
1590
+ case "allergy_autofill":
1591
+ return "PluginField";
1592
+ case "linked_data":
1593
+ case "linked_data_rare":
1594
+ return "PluginField";
1595
+ case "score_display":
1596
+ case "score_explanation":
1597
+ return "Message";
1598
+ default:
1599
+ return info.Label;
1600
+ }
1601
+ }
1602
+ function getCoreEmrTypeLabel(typeCode) {
1603
+ return `${(0, _CorEMRElementTypeMap.getElementTypeInfo)(typeCode).Label} (${typeCode})`;
1604
+ }
1605
+ function toTemplateMapping(origin, importedAt, facts, form) {
1606
+ const instrumentMapping = (0, _Option.defaultArg)((0, _Option.map)((e)=>e.Archived, (0, _Map.tryFind)((0, _Util.int32ToString)(form.FormId), facts.Instruments)), false) ? 40 : 100;
1607
+ const hasBlueprintCode = form.FormCode.length > 0 && !(form.FormCode.indexOf("#") >= 0);
1608
+ const matchValue = (0, _CoreMRImportPipeline.runPipeline)(origin, importedAt, facts, form);
1609
+ if (matchValue.tag === /* Ok */ 0) {
1610
+ const sourceMap = matchValue.fields[0][1];
1611
+ const formSpec = matchValue.fields[0][0];
1612
+ let readsById;
1613
+ const matchValue_1 = facts.Triggers;
1614
+ switch(matchValue_1.tag){
1615
+ case /* NotInRelease */ 1:
1616
+ case /* NotReadYet */ 2:
1617
+ {
1618
+ readsById = (0, _Map.empty)({
1619
+ Compare: _Util.comparePrimitives
1620
+ });
1621
+ break;
1622
+ }
1623
+ default:
1624
+ readsById = (0, _Map.ofList)((0, _List.map)((t)=>[
1625
+ t.TriggerId,
1626
+ t
1627
+ ], matchValue_1.fields[0]), {
1628
+ Compare: _Util.comparePrimitives
1629
+ });
1630
+ }
1631
+ const fieldKeyMap = (0, _Map.ofList)((0, _List.map)((anchor)=>[
1632
+ anchor.ItemId,
1633
+ anchor.FieldKey
1634
+ ], (0, _List.collect)((step)=>step.FieldAnchors, sourceMap.Steps)), {
1635
+ Compare: _Util.comparePrimitives
1636
+ });
1637
+ const finalSteps = (0, _List.map2)((fStep, sStep)=>new StepMapping(fStep.StepOrder, fStep.StepLabel, (0, _List.map2)((field, anchor_1)=>{
1638
+ const fieldTypeName = getFieldTypeName(field.FieldType);
1639
+ const itemTriggers = (0, _List.map)((t_1)=>toTriggerMapping(form.Items, readsById, t_1, fieldKeyMap), anchor_1.Triggers);
1640
+ return new FieldMapping(`f-${anchor_1.ItemId}`, anchor_1.ItemId, field.FieldOrder, field.Label, fieldTypeName, anchor_1.ItemTypeId, getCoreEmrTypeLabel(anchor_1.ItemTypeId), (0, _List.isEmpty)(anchor_1.Choices) ? "-" : (0, _String.join)(", ", (0, _List.map)((c_1)=>(0, _Util.int64ToString)(c_1.Score), (0, _List.sortBy)((c)=>c.Sequence, anchor_1.Choices, {
1641
+ Compare: _Util.comparePrimitives
1642
+ }))), anchor_1.Code, !field.IsOptional, (0, _List.length)(anchor_1.Choices), (0, _List.isEmpty)(anchor_1.Choices) ? "-" : `${(0, _List.length)(anchor_1.Choices)} scored`, `Item ${anchor_1.ItemId} / SSOT`, field.FieldType.tag === /* UnsupportedField */ 22 ? FieldMappingStatus_Unsupported() : FieldMappingStatus_Mapped(), itemTriggers);
1643
+ }, fStep.Fields, sStep.FieldAnchors)), formSpec.Steps, sourceMap.Steps);
1644
+ const allFields = (0, _List.collect)((s)=>s.Fields, finalSteps);
1645
+ const totalFields = (0, _List.length)(allFields) | 0;
1646
+ const codedFieldCount = (0, _List.length)((0, _List.filter)((f)=>f.Code != null, allFields)) | 0;
1647
+ const requiredFieldCount = (0, _List.length)((0, _List.filter)((f_1)=>f_1.Required, allFields)) | 0;
1648
+ const choiceFields = (0, _List.length)((0, _List.filter)((f_2)=>f_2.Options > 0, allFields)) | 0;
1649
+ const bitmaskFields = (0, _List.length)((0, _List.filter)((f_3)=>{
1650
+ if ((f_3.CoreEmrType === 26 ? true : f_3.CoreEmrType === 40) ? true : f_3.CoreEmrType === 41) {
1651
+ return true;
1652
+ } else {
1653
+ return f_3.CoreEmrType === 143;
1654
+ }
1655
+ }, allFields)) | 0;
1656
+ const bitmaskCoverage = choiceFields > 0 ? bitmaskFields / choiceFields * 100 : 0;
1657
+ const triggeredFields = (0, _List.filter)((f_4)=>!(0, _List.isEmpty)(f_4.Triggers), allFields);
1658
+ const triggerCount = (0, _List.sumBy)((f_5)=>(0, _List.length)(f_5.Triggers), allFields, {
1659
+ GetZero: ()=>0,
1660
+ Add: (x_4, y_4)=>x_4 + y_4
1661
+ }) | 0;
1662
+ const triggeredFieldCount = (0, _List.length)(triggeredFields) | 0;
1663
+ const triggerActionBreakdown = (0, _Map.ofList)((0, _Seq2.List_countBy)((x_5)=>x_5, (0, _List.map)((a)=>(0, _Array.item)(0, (0, _String.split)(a.CoreEmrAction, [
1664
+ ":"
1665
+ ], undefined, 0)).trim(), (0, _List.collect)((t_2)=>t_2.Actions, (0, _List.collect)((f_6)=>f_6.Triggers, allFields))), {
1666
+ Equals: (x_6, y_5)=>x_6 === y_5,
1667
+ GetHashCode: _Util.stringHash
1668
+ }), {
1669
+ Compare: _Util.comparePrimitives
1670
+ });
1671
+ const mappedCount = (0, _List.length)((0, _List.filter)((f_7)=>(0, _Util.equals)(f_7.Status, FieldMappingStatus_Mapped()), allFields)) | 0;
1672
+ const unsupportedCount = (0, _List.length)((0, _List.filter)((f_8)=>(0, _Util.equals)(f_8.Status, FieldMappingStatus_Unsupported()), allFields)) | 0;
1673
+ const instrumentSignal = instrumentMapping;
1674
+ const pipelineReadiness = (0, _Double.min)(100, (0, _Double.max)(0, (totalFields > 0 ? mappedCount / totalFields * 100 : 0) * 0.4 + (triggerCount > 0 ? 100 : 100) * 0.25 + (hasBlueprintCode ? 100 : 0) * 0.2 + instrumentSignal * 0.15));
1675
+ const pipelineStatus = pipelineReadiness >= 75 ? TemplateStatus_Ready() : pipelineReadiness >= 50 ? TemplateStatus_Issues() : pipelineReadiness >= 25 ? TemplateStatus_Drift() : TemplateStatus_Blocked();
1676
+ const codeCoverage = totalFields > 0 ? codedFieldCount / totalFields * 100 : 0;
1677
+ const requiredDensity = totalFields > 0 ? requiredFieldCount / totalFields * 100 : 0;
1678
+ const encounterTypes = (0, _Seq.toList)((0, _Seq.delay)(()=>(0, _Seq.append)(form.EncounterTypes.Medical ? (0, _Seq.singleton)("medical") : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(form.EncounterTypes.Mental ? (0, _Seq.singleton)("mental") : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _Seq.append)(form.EncounterTypes.Dental ? (0, _Seq.singleton)("dental") : (0, _Seq.empty)(), (0, _Seq.delay)(()=>(0, _FormTemplateDecoder.ReleaseAvailability_statedTrue)(form.EncounterTypes.Other) ? (0, _Seq.singleton)("other") : (0, _Seq.empty)()))))))));
1679
+ return ok(new TemplateMapping((0, _Util.int32ToString)(form.FormId), form.FormCode, form.Name, formSpec.Id, (0, _Option.defaultArg)(formSpec.Code, form.FormCode), formSpec.Title, form.Usage, (0, _Util.round)(pipelineReadiness, 0), pipelineStatus, totalFields, choiceFields, bitmaskFields, (0, _Util.round)(bitmaskCoverage, 0), (0, _Util.round)(codeCoverage, 0), codedFieldCount, (0, _Util.round)(requiredDensity, 0), requiredFieldCount, form.Scoring != null ? 100 : 0, (0, _Util.round)(instrumentSignal, 0), hasBlueprintCode, triggerCount, triggeredFieldCount, triggerActionBreakdown, form.IsIntake, form.Scoring != null, encounterTypes, form.Usage, form.RequiresSignature, form.StructureHash, formSpec, (0, _Encode.toString)(2, (0, _Encode.Auto_generateBoxedEncoder_437914C6)((0, _FormSpec.Spec_FormSpec$1_$reflection)((0, _FormSpec.Spec_FieldType_$reflection)()), undefined, undefined, undefined)(formSpec)), finalSteps));
1680
+ } else {
1681
+ return (0, _Result.FSharpResult$2_Error)(matchValue.fields[0]);
1682
+ }
1683
+ }
1684
+ class LandingAnalysis extends _Types.Record {
1685
+ constructor(Header, Stats, Templates, Verdicts, Triggers, InactiveEverywhere){
1686
+ super();
1687
+ this.Header = Header;
1688
+ this.Stats = Stats;
1689
+ this.Templates = Templates;
1690
+ this.Verdicts = Verdicts;
1691
+ this.Triggers = Triggers;
1692
+ this.InactiveEverywhere = InactiveEverywhere;
1693
+ }
1694
+ }
1695
+ function LandingAnalysis_$reflection() {
1696
+ return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CoreMRImporterAnalysis.LandingAnalysis", [], LandingAnalysis, ()=>[
1697
+ [
1698
+ "Header",
1699
+ Manifest_$reflection()
1700
+ ],
1701
+ [
1702
+ "Stats",
1703
+ ManifestStats_$reflection()
1704
+ ],
1705
+ [
1706
+ "Templates",
1707
+ (0, _Reflection.list_type)(TemplateListItem_$reflection())
1708
+ ],
1709
+ [
1710
+ "Verdicts",
1711
+ (0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
1712
+ _Reflection.string_type,
1713
+ (0, _Reflection.list_type)(_Reflection.string_type)
1714
+ ])
1715
+ ],
1716
+ [
1717
+ "Triggers",
1718
+ (0, _FormTemplateDecoder.ReleaseAvailability$1_$reflection)((0, _FormTemplateDecoder.TriggerStats_$reflection)())
1719
+ ],
1720
+ [
1721
+ "InactiveEverywhere",
1722
+ (0, _Reflection.list_type)(_Reflection.string_type)
1723
+ ]
1724
+ ]);
1725
+ }
1726
+ function analyse(origin, importedAt, source, factsOf, activeAtOf) {
1727
+ const mappings = (0, _Map.map)((_arg, form)=>toTemplateMapping(origin, importedAt, factsOf(form), form), source.Forms);
1728
+ return new LandingAnalysis(toManifest(source), computeStats(source), toTemplateListFromMappings(source, mappings), (0, _Map.ofList)((0, _List.choose)((tupledArg)=>{
1729
+ const r = tupledArg[1];
1730
+ if (r.tag === /* Ok */ 0) {
1731
+ return undefined;
1732
+ } else {
1733
+ return [
1734
+ tupledArg[0],
1735
+ r.fields[0]
1736
+ ];
1737
+ }
1738
+ }, (0, _Map.toList)(mappings)), {
1739
+ Compare: _Util.comparePrimitives
1740
+ }), source.Triggers, (0, _List.map)((tuple)=>tuple[0], (0, _List.filter)((tupledArg_1)=>(0, _List.isEmpty)(activeAtOf(tupledArg_1[1])), (0, _Map.toList)(source.Forms))));
1741
+ } //# sourceMappingURL=CoreMRImporterAnalysis.ts.map
1742
+
1743
+ //# sourceMappingURL=CoreMRImporterAnalysis.js.map