@f1studio/form-spec 5.0.0-alpha.164 → 5.0.0-alpha.165
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/BlueprintValidation.js +1 -1
- package/FormSpec.FS/BlueprintValidation.js.map +1 -1
- package/FormSpec.FS/Designer.js +1 -1
- package/FormSpec.FS/Designer.js.map +1 -1
- package/FormSpec.FS/FormSpec.d.ts +14 -1
- package/FormSpec.FS/FormSpec.d.ts.map +1 -1
- package/FormSpec.FS/FormSpec.js +56 -1
- package/FormSpec.FS/FormSpec.js.map +1 -1
- package/FormSpec.FS/FormSpecHelpers.js +1 -1
- package/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.FS/FormSpecValues.js +1 -1
- package/FormSpec.FS/FormSpecValues.js.map +1 -1
- package/FormSpec.FS/Helpers.js +11 -11
- package/FormSpec.FS/Helpers.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts +13 -3
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js +19 -13
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts +20 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +20 -40
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts +21 -9
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js +46 -25
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts +3 -4
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js +93 -36
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts +33 -8
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +25 -29
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +4 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +4 -4
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.js +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.js.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +40 -8
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +201 -22
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +4 -4
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +26 -2
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.js +77 -3
- package/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.FS/Provenance.d.ts +20 -2
- package/FormSpec.FS/Provenance.d.ts.map +1 -1
- package/FormSpec.FS/Provenance.js +66 -3
- package/FormSpec.FS/Provenance.js.map +1 -1
- package/README.md +7 -7
- package/package.json +1 -1
- package/src/FormSpec.FS/BlueprintValidation.ts +1 -1
- package/src/FormSpec.FS/Designer.ts +1 -1
- package/src/FormSpec.FS/FormSpec.ts +32 -2
- package/src/FormSpec.FS/FormSpecHelpers.ts +1 -1
- package/src/FormSpec.FS/FormSpecValues.ts +1 -1
- package/src/FormSpec.FS/Helpers.ts +11 -11
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts +25 -12
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +41 -41
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts +62 -30
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateMapper.ts +77 -30
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +52 -27
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +7 -5
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRTriggerEnrichment.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +1 -1
- package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +160 -25
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +4 -4
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +63 -8
- package/src/FormSpec.FS/Provenance.ts +50 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FSharpRef, Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
|
-
import { uncurry2, IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
2
|
+
import { uncurry2, comparePrimitives, IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
3
3
|
import { obj_type, enum_type, int32_type, array_type, bool_type, option_type, record_type, string_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
4
|
-
import { map as map_2, value as value_2, Option } from "@fable-org/fable-library-js/Option.js";
|
|
4
|
+
import { bind, map as map_2, value as value_2, Option } from "@fable-org/fable-library-js/Option.js";
|
|
5
5
|
import { int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
6
|
-
import { Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection, Spec_FormClassification_General, Spec_FormLifecycle_Blueprint, Spec_FormSpec$1, Spec_FilledMeta, Spec_FormLifecycle_$union, ClinicalPathway_ClinicalPathwaySpec, Spec_Score, Spec_ScoreRange, Spec_ScoreColor_Danger, Spec_ScoreColor_Warning, Spec_ScoreColor_Success, Spec_ScoreColor_Info, Spec_ScoreColor_Link, Spec_ScoreColor_Primary, Spec_ScoreColor_Unspecified, Spec_ScoreColor_$union, Spec_FormStep$1, Spec_FormField$1, Shared_FieldValue_$union, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Message, Spec_FieldType_Signature, Spec_SignatureInfo, Spec_FieldType_Matrix, Spec_FieldType_TextAutoComplete, Spec_FieldType_TagList, Spec_FieldType_CheckboxList, Spec_FieldType_MultiChoice, Spec_MultiChoiceInfo, Spec_FieldType_Dropdown, Spec_FieldType_SingleChoice, Spec_FieldType_Radio, Spec_SingleChoiceInfo, Spec_FieldType_Checkbox, Spec_FieldType_Time, Spec_FieldType_DateTimeLocal, Spec_FieldType_Date, Spec_FieldType_Tel, Spec_FieldType_Number, Spec_FieldType_Color, Spec_FieldType_Search, Spec_FieldType_Password, Spec_FieldType_Email, Spec_FieldType_TextArea, Spec_FieldType_Text, Spec_TextInfo, Spec_FieldType_$union, Spec_MessageInfo, Spec_MatrixInfo, Spec_BooleanInfo, Spec_MessageType_Danger, Spec_MessageType_Info, Spec_MessageType_Error, Spec_MessageType_Success, Spec_MessageType_Warning, Spec_MessageType_$union, Spec_DependsOn, Spec_Evaluator_Contains, Spec_Evaluator_IsEmpty, Spec_Evaluator_Exists, Spec_Evaluator_LessThanOrEquals, Spec_Evaluator_LessThan, Spec_Evaluator_GreaterThanOrEquals, Spec_Evaluator_GreaterThan, Spec_Evaluator_NotEquals, Spec_Evaluator_Equals, Spec_Evaluator_$union, Shared_FieldOption, Shared_FieldOptionKey, Shared_MatrixItemKey, Shared_TransitionKey, Shared_StateKey, Shared_FieldKey } from "../FormSpec.js";
|
|
6
|
+
import { Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection, Spec_FormClassification_General, Spec_FormLifecycle_Blueprint, Spec_FormSpec$1, Spec_FilledMeta, Spec_FormLifecycle_$union, ClinicalPathway_ClinicalPathwaySpec, Spec_VendorScore, Spec_VendorScoreBand, Spec_Score, Spec_ScoreRange, Spec_ScoreColor_Danger, Spec_ScoreColor_Warning, Spec_ScoreColor_Success, Spec_ScoreColor_Info, Spec_ScoreColor_Link, Spec_ScoreColor_Primary, Spec_ScoreColor_Unspecified, Spec_ScoreColor_$union, Spec_FormStep$1, Spec_FormField$1, Shared_FieldValue_$union, Spec_FieldType_PluginField, Spec_PluginFieldConfig, Spec_FieldType_Message, Spec_FieldType_Signature, Spec_SignatureInfo, Spec_FieldType_Matrix, Spec_FieldType_TextAutoComplete, Spec_FieldType_TagList, Spec_FieldType_CheckboxList, Spec_FieldType_MultiChoice, Spec_MultiChoiceInfo, Spec_FieldType_Dropdown, Spec_FieldType_SingleChoice, Spec_FieldType_Radio, Spec_SingleChoiceInfo, Spec_FieldType_Checkbox, Spec_FieldType_Time, Spec_FieldType_DateTimeLocal, Spec_FieldType_Date, Spec_FieldType_Tel, Spec_FieldType_Number, Spec_FieldType_Color, Spec_FieldType_Search, Spec_FieldType_Password, Spec_FieldType_Email, Spec_FieldType_TextArea, Spec_FieldType_Text, Spec_TextInfo, Spec_FieldType_$union, Spec_MessageInfo, Spec_MatrixInfo, Spec_BooleanInfo, Spec_MessageType_Danger, Spec_MessageType_Info, Spec_MessageType_Error, Spec_MessageType_Success, Spec_MessageType_Warning, Spec_MessageType_$union, Spec_DependsOn, Spec_Evaluator_Contains, Spec_Evaluator_IsEmpty, Spec_Evaluator_Exists, Spec_Evaluator_LessThanOrEquals, Spec_Evaluator_LessThan, Spec_Evaluator_GreaterThanOrEquals, Spec_Evaluator_GreaterThan, Spec_Evaluator_NotEquals, Spec_Evaluator_Equals, Spec_Evaluator_$union, Shared_FieldOption, Shared_FieldOptionKey, Shared_MatrixItemKey, Shared_TransitionKey, Shared_StateKey, Shared_FieldKey } from "../FormSpec.js";
|
|
7
7
|
import { tryParse } from "@fable-org/fable-library-js/Guid.js";
|
|
8
|
-
import { ofArray, reverse, empty, FSharpList, cons, map, toArray } from "@fable-org/fable-library-js/List.js";
|
|
8
|
+
import { sortBy, isEmpty, ofArray, reverse, empty, FSharpList, cons, map, toArray } from "@fable-org/fable-library-js/List.js";
|
|
9
9
|
import { sumBy, tryFind, collect, map as map_1, fold } from "@fable-org/fable-library-js/Array.js";
|
|
10
10
|
import { Auto_generateBoxedEncoder_437914C6, toString } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
|
|
11
11
|
import { FSharpResult$2_$union, Result_ToOption } from "@fable-org/fable-library-js/Result.js";
|
|
@@ -366,6 +366,34 @@ export function Types_ClinicalPathwaySpecTS_$reflection(): TypeInfo {
|
|
|
366
366
|
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.ClinicalPathwaySpecTS", [], Types_ClinicalPathwaySpecTS, () => [["PathwayId", string_type], ["PathwayName", string_type], ["Version", string_type], ["ProtocolSource", string_type]]);
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
+
export class Types_VendorScoreBandTS extends Record implements IEquatable<Types_VendorScoreBandTS>, IComparable<Types_VendorScoreBandTS> {
|
|
370
|
+
readonly Label: string;
|
|
371
|
+
readonly Min: int32;
|
|
372
|
+
constructor(Label: string, Min: int32) {
|
|
373
|
+
super();
|
|
374
|
+
this.Label = Label;
|
|
375
|
+
this.Min = (Min | 0);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export function Types_VendorScoreBandTS_$reflection(): TypeInfo {
|
|
380
|
+
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.VendorScoreBandTS", [], Types_VendorScoreBandTS, () => [["Label", string_type], ["Min", int32_type]]);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export class Types_VendorScoreTS extends Record implements IEquatable<Types_VendorScoreTS>, IComparable<Types_VendorScoreTS> {
|
|
384
|
+
readonly ScaleName: string;
|
|
385
|
+
readonly Bands: Types_VendorScoreBandTS[];
|
|
386
|
+
constructor(ScaleName: string, Bands: Types_VendorScoreBandTS[]) {
|
|
387
|
+
super();
|
|
388
|
+
this.ScaleName = ScaleName;
|
|
389
|
+
this.Bands = Bands;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export function Types_VendorScoreTS_$reflection(): TypeInfo {
|
|
394
|
+
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.VendorScoreTS", [], Types_VendorScoreTS, () => [["ScaleName", string_type], ["Bands", array_type(Types_VendorScoreBandTS_$reflection())]]);
|
|
395
|
+
}
|
|
396
|
+
|
|
369
397
|
export class Types_FormSpecTS extends Record implements IEquatable<Types_FormSpecTS> {
|
|
370
398
|
readonly Id: string;
|
|
371
399
|
readonly Code: Option<string>;
|
|
@@ -376,13 +404,14 @@ export class Types_FormSpecTS extends Record implements IEquatable<Types_FormSpe
|
|
|
376
404
|
readonly Steps: Types_FormStepTS[];
|
|
377
405
|
readonly CategoryTags: string[];
|
|
378
406
|
readonly Score: Option<Types_ScoreTS>;
|
|
407
|
+
readonly VendorScore: Option<Types_VendorScoreTS>;
|
|
379
408
|
readonly AssociatedCodes: string[];
|
|
380
409
|
readonly RequiresReview: boolean;
|
|
381
410
|
readonly RequiresReviewAndApproval: boolean;
|
|
382
411
|
readonly ClinicalPathway: Option<Types_ClinicalPathwaySpecTS>;
|
|
383
412
|
readonly Lifecycle: string;
|
|
384
413
|
readonly FilledMeta: Option<any>;
|
|
385
|
-
constructor(Id: string, Code: Option<string>, Title: string, Abstract: string, Version: string, FormSpecVersion: string, Steps: Types_FormStepTS[], CategoryTags: string[], Score: Option<Types_ScoreTS>, AssociatedCodes: string[], RequiresReview: boolean, RequiresReviewAndApproval: boolean, ClinicalPathway: Option<Types_ClinicalPathwaySpecTS>, Lifecycle: string, FilledMeta: Option<any>) {
|
|
414
|
+
constructor(Id: string, Code: Option<string>, Title: string, Abstract: string, Version: string, FormSpecVersion: string, Steps: Types_FormStepTS[], CategoryTags: string[], Score: Option<Types_ScoreTS>, VendorScore: Option<Types_VendorScoreTS>, AssociatedCodes: string[], RequiresReview: boolean, RequiresReviewAndApproval: boolean, ClinicalPathway: Option<Types_ClinicalPathwaySpecTS>, Lifecycle: string, FilledMeta: Option<any>) {
|
|
386
415
|
super();
|
|
387
416
|
this.Id = Id;
|
|
388
417
|
this.Code = Code;
|
|
@@ -393,6 +422,7 @@ export class Types_FormSpecTS extends Record implements IEquatable<Types_FormSpe
|
|
|
393
422
|
this.Steps = Steps;
|
|
394
423
|
this.CategoryTags = CategoryTags;
|
|
395
424
|
this.Score = Score;
|
|
425
|
+
this.VendorScore = VendorScore;
|
|
396
426
|
this.AssociatedCodes = AssociatedCodes;
|
|
397
427
|
this.RequiresReview = RequiresReview;
|
|
398
428
|
this.RequiresReviewAndApproval = RequiresReviewAndApproval;
|
|
@@ -403,7 +433,7 @@ export class Types_FormSpecTS extends Record implements IEquatable<Types_FormSpe
|
|
|
403
433
|
}
|
|
404
434
|
|
|
405
435
|
export function Types_FormSpecTS_$reflection(): TypeInfo {
|
|
406
|
-
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.FormSpecTS", [], Types_FormSpecTS, () => [["Id", string_type], ["Code", option_type(string_type)], ["Title", string_type], ["Abstract", string_type], ["Version", string_type], ["FormSpecVersion", string_type], ["Steps", array_type(Types_FormStepTS_$reflection())], ["CategoryTags", array_type(string_type)], ["Score", option_type(Types_ScoreTS_$reflection())], ["AssociatedCodes", array_type(string_type)], ["RequiresReview", bool_type], ["RequiresReviewAndApproval", bool_type], ["ClinicalPathway", option_type(Types_ClinicalPathwaySpecTS_$reflection())], ["Lifecycle", string_type], ["FilledMeta", option_type(obj_type)]]);
|
|
436
|
+
return record_type("F1.Studio.FormSpec.Interop.OptionBased.Types.FormSpecTS", [], Types_FormSpecTS, () => [["Id", string_type], ["Code", option_type(string_type)], ["Title", string_type], ["Abstract", string_type], ["Version", string_type], ["FormSpecVersion", string_type], ["Steps", array_type(Types_FormStepTS_$reflection())], ["CategoryTags", array_type(string_type)], ["Score", option_type(Types_ScoreTS_$reflection())], ["VendorScore", option_type(Types_VendorScoreTS_$reflection())], ["AssociatedCodes", array_type(string_type)], ["RequiresReview", bool_type], ["RequiresReviewAndApproval", bool_type], ["ClinicalPathway", option_type(Types_ClinicalPathwaySpecTS_$reflection())], ["Lifecycle", string_type], ["FilledMeta", option_type(obj_type)]]);
|
|
407
437
|
}
|
|
408
438
|
|
|
409
439
|
/**
|
|
@@ -1381,6 +1411,31 @@ export function Converters_scoreFromTS(score: Types_ScoreTS): Option<Spec_Score>
|
|
|
1381
1411
|
}
|
|
1382
1412
|
}
|
|
1383
1413
|
|
|
1414
|
+
/**
|
|
1415
|
+
* Convert F# VendorScore to TypeScript representation
|
|
1416
|
+
*/
|
|
1417
|
+
export function Converters_vendorScoreToTS(score: Spec_VendorScore): Types_VendorScoreTS {
|
|
1418
|
+
return new Types_VendorScoreTS(score.ScaleName, toArray<Types_VendorScoreBandTS>(map<Spec_VendorScoreBand, Types_VendorScoreBandTS>((b: Spec_VendorScoreBand): Types_VendorScoreBandTS => (new Types_VendorScoreBandTS(b.Label, b.Min)), score.Bands)));
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Convert TypeScript VendorScore to F# representation.
|
|
1423
|
+
* ⛔ Refuses a scale with no bands — see <c>Spec.VendorScore</c>. A named scale whose bands
|
|
1424
|
+
* did not survive cannot say what a total means, and half a sentence invites the reader to
|
|
1425
|
+
* invent the other half.
|
|
1426
|
+
*/
|
|
1427
|
+
export function Converters_vendorScoreFromTS(score: Types_VendorScoreTS): Option<Spec_VendorScore> {
|
|
1428
|
+
const bands: FSharpList<Spec_VendorScoreBand> = map<Types_VendorScoreBandTS, Spec_VendorScoreBand>((b: Types_VendorScoreBandTS): Spec_VendorScoreBand => (new Spec_VendorScoreBand(b.Label, b.Min)), ofArray<Types_VendorScoreBandTS>(score.Bands));
|
|
1429
|
+
if (isEmpty(bands)) {
|
|
1430
|
+
return undefined;
|
|
1431
|
+
}
|
|
1432
|
+
else {
|
|
1433
|
+
return new Spec_VendorScore(score.ScaleName, sortBy<Spec_VendorScoreBand, int32>((b_1: Spec_VendorScoreBand): int32 => b_1.Min, bands, {
|
|
1434
|
+
Compare: comparePrimitives,
|
|
1435
|
+
}));
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1384
1439
|
/**
|
|
1385
1440
|
* Convert F# ClinicalPathwaySpec to TypeScript representation (simplified)
|
|
1386
1441
|
*/
|
|
@@ -1413,7 +1468,7 @@ export function Converters_lifecycleToString(lifecycle: Spec_FormLifecycle_$unio
|
|
|
1413
1468
|
}
|
|
1414
1469
|
|
|
1415
1470
|
export function Converters_formSpecToTS(spec: Spec_FormSpec$1<Spec_FieldType_$union>): Types_FormSpecTS {
|
|
1416
|
-
return new Types_FormSpecTS(spec.Id, spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, toArray<Types_FormStepTS>(map<Spec_FormStep$1<Spec_FieldType_$union>, Types_FormStepTS>(Converters_formStepToTS, spec.Steps)), toArray<string>(spec.CategoryTags), map_2<Spec_Score, Types_ScoreTS>(Converters_scoreToTS, spec.Score), toArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, map_2<ClinicalPathway_ClinicalPathwaySpec, Types_ClinicalPathwaySpecTS>(Converters_clinicalPathwayToTS, spec.ClinicalPathway), Converters_lifecycleToString(spec.Lifecycle), map_2<Spec_FilledMeta, any>((value: Spec_FilledMeta): any => value, spec.FilledMeta));
|
|
1471
|
+
return new Types_FormSpecTS(spec.Id, spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, toArray<Types_FormStepTS>(map<Spec_FormStep$1<Spec_FieldType_$union>, Types_FormStepTS>(Converters_formStepToTS, spec.Steps)), toArray<string>(spec.CategoryTags), map_2<Spec_Score, Types_ScoreTS>(Converters_scoreToTS, spec.Score), map_2<Spec_VendorScore, Types_VendorScoreTS>(Converters_vendorScoreToTS, spec.VendorScore), toArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, map_2<ClinicalPathway_ClinicalPathwaySpec, Types_ClinicalPathwaySpecTS>(Converters_clinicalPathwayToTS, spec.ClinicalPathway), Converters_lifecycleToString(spec.Lifecycle), map_2<Spec_FilledMeta, any>((value: Spec_FilledMeta): any => value, spec.FilledMeta));
|
|
1417
1472
|
}
|
|
1418
1473
|
|
|
1419
1474
|
/**
|
|
@@ -1455,7 +1510,7 @@ export function Converters_formSpecFromTS(spec: Types_FormSpecTS): Option<Spec_F
|
|
|
1455
1510
|
return undefined;
|
|
1456
1511
|
}
|
|
1457
1512
|
else {
|
|
1458
|
-
return new Spec_FormSpec$1(matchValue[1], spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, reverse<Spec_FormStep$1<Spec_FieldType_$union>>(value_2(convertedSteps)), ofArray<string>(spec.CategoryTags), scoreResult, ofArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined, Spec_FormClassification_General());
|
|
1513
|
+
return new Spec_FormSpec$1(matchValue[1], spec.Code, spec.Title, spec.Abstract, spec.Version, spec.FormSpecVersion, reverse<Spec_FormStep$1<Spec_FieldType_$union>>(value_2(convertedSteps)), ofArray<string>(spec.CategoryTags), scoreResult, bind<Types_VendorScoreTS, Spec_VendorScore>(Converters_vendorScoreFromTS, spec.VendorScore), ofArray<string>(spec.AssociatedCodes), spec.RequiresReview, spec.RequiresReviewAndApproval, undefined, Spec_FormLifecycle_Blueprint(), undefined, undefined, undefined, Spec_FormClassification_General());
|
|
1459
1514
|
}
|
|
1460
1515
|
}
|
|
1461
1516
|
else {
|
|
@@ -1,19 +1,65 @@
|
|
|
1
1
|
import { Record } from "@fable-org/fable-library-js/Types.js";
|
|
2
2
|
import { IComparable, IEquatable } from "@fable-org/fable-library-js/Util.js";
|
|
3
3
|
import { record_type, string_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
4
|
+
import { isNullOrWhiteSpace } from "@fable-org/fable-library-js/String.js";
|
|
4
5
|
|
|
5
6
|
export class IntegrationProvenance extends Record implements IEquatable<IntegrationProvenance>, IComparable<IntegrationProvenance> {
|
|
6
|
-
readonly
|
|
7
|
+
readonly Vendor: string;
|
|
8
|
+
readonly TenantId: string;
|
|
9
|
+
readonly SiteId: string;
|
|
7
10
|
readonly Payload: string;
|
|
8
|
-
constructor(
|
|
11
|
+
constructor(Vendor: string, TenantId: string, SiteId: string, Payload: string) {
|
|
9
12
|
super();
|
|
10
|
-
this.
|
|
13
|
+
this.Vendor = Vendor;
|
|
14
|
+
this.TenantId = TenantId;
|
|
15
|
+
this.SiteId = SiteId;
|
|
11
16
|
this.Payload = Payload;
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
export function IntegrationProvenance_$reflection(): TypeInfo {
|
|
16
|
-
return record_type("F1.Studio.Provenance.IntegrationProvenance", [], IntegrationProvenance, () => [["
|
|
21
|
+
return record_type("F1.Studio.Provenance.IntegrationProvenance", [], IntegrationProvenance, () => [["Vendor", string_type], ["TenantId", string_type], ["SiteId", string_type], ["Payload", string_type]]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ImportOrigin extends Record implements IEquatable<ImportOrigin>, IComparable<ImportOrigin> {
|
|
25
|
+
readonly Vendor: string;
|
|
26
|
+
readonly TenantId: string;
|
|
27
|
+
readonly SiteId: string;
|
|
28
|
+
constructor(Vendor: string, TenantId: string, SiteId: string) {
|
|
29
|
+
super();
|
|
30
|
+
this.Vendor = Vendor;
|
|
31
|
+
this.TenantId = TenantId;
|
|
32
|
+
this.SiteId = SiteId;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function ImportOrigin_$reflection(): TypeInfo {
|
|
37
|
+
return record_type("F1.Studio.Provenance.ImportOrigin", [], ImportOrigin, () => [["Vendor", string_type], ["TenantId", string_type], ["SiteId", string_type]]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* ⛔ FAILS LOUDLY. A blank tenant or site is not "unknown, fill it in later" — it is an import
|
|
42
|
+
* whose payload can never be resolved back, and it must not be written at all.
|
|
43
|
+
*/
|
|
44
|
+
export function ImportOriginModule_create(vendor: string, tenantId: string, siteId: string): ImportOrigin {
|
|
45
|
+
const blank = isNullOrWhiteSpace;
|
|
46
|
+
if (blank(vendor)) {
|
|
47
|
+
throw new Error("ImportOrigin: vendor is required (e.g. \"coremr\").");
|
|
48
|
+
}
|
|
49
|
+
if (blank(tenantId)) {
|
|
50
|
+
throw new Error("ImportOrigin: tenantId is required — a blueprint belongs to an organisation.");
|
|
51
|
+
}
|
|
52
|
+
if (blank(siteId)) {
|
|
53
|
+
throw new Error("ImportOrigin: siteId is required — every formId/itemId/choiceId in the payload is scoped to ONE CoreMR database, and without it the provenance cannot be resolved back.");
|
|
54
|
+
}
|
|
55
|
+
return new ImportOrigin(vendor.trim(), tenantId.trim(), siteId.trim());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The provenance for a payload read under this origin.
|
|
60
|
+
*/
|
|
61
|
+
export function ImportOriginModule_provenance(o: ImportOrigin, payload: string): IntegrationProvenance {
|
|
62
|
+
return new IntegrationProvenance(o.Vendor, o.TenantId, o.SiteId, payload);
|
|
17
63
|
}
|
|
18
64
|
|
|
19
65
|
//# sourceMappingURL=Provenance.ts.map
|