@awell-health/ui-library 0.1.41 → 0.1.42

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/dist/index.js CHANGED
@@ -15894,6 +15894,7 @@ Check the top-level render call using <` + t + ">.");
15894
15894
  ActivityAction["Delegated"] = "DELEGATED";
15895
15895
  ActivityAction["Deliver"] = "DELIVER";
15896
15896
  ActivityAction["Discarded"] = "DISCARDED";
15897
+ ActivityAction["Expired"] = "EXPIRED";
15897
15898
  ActivityAction["Failed"] = "FAILED";
15898
15899
  ActivityAction["FailedToSend"] = "FAILED_TO_SEND";
15899
15900
  ActivityAction["Generated"] = "GENERATED";
@@ -15933,6 +15934,7 @@ Check the top-level render call using <` + t + ">.");
15933
15934
  })(exports.ActivityObjectType || (exports.ActivityObjectType = {}));
15934
15935
  exports.ActivityResolution = void 0;
15935
15936
  (function (ActivityResolution) {
15937
+ ActivityResolution["Expired"] = "EXPIRED";
15936
15938
  ActivityResolution["Failure"] = "FAILURE";
15937
15939
  ActivityResolution["Success"] = "SUCCESS";
15938
15940
  })(exports.ActivityResolution || (exports.ActivityResolution = {}));
@@ -15941,6 +15943,7 @@ Check the top-level render call using <` + t + ">.");
15941
15943
  ActivityStatus["Active"] = "ACTIVE";
15942
15944
  ActivityStatus["Canceled"] = "CANCELED";
15943
15945
  ActivityStatus["Done"] = "DONE";
15946
+ ActivityStatus["Expired"] = "EXPIRED";
15944
15947
  ActivityStatus["Failed"] = "FAILED";
15945
15948
  })(exports.ActivityStatus || (exports.ActivityStatus = {}));
15946
15949
  exports.ActivitySubjectType = void 0;
@@ -15978,6 +15981,7 @@ Check the top-level render call using <` + t + ">.");
15978
15981
  ConditionOperandType["Number"] = "NUMBER";
15979
15982
  ConditionOperandType["NumbersArray"] = "NUMBERS_ARRAY";
15980
15983
  ConditionOperandType["String"] = "STRING";
15984
+ ConditionOperandType["StringsArray"] = "STRINGS_ARRAY";
15981
15985
  })(exports.ConditionOperandType || (exports.ConditionOperandType = {}));
15982
15986
  exports.ConditionOperator = void 0;
15983
15987
  (function (ConditionOperator) {
@@ -16018,6 +16022,7 @@ Check the top-level render call using <` + t + ">.");
16018
16022
  DataPointValueType["Number"] = "NUMBER";
16019
16023
  DataPointValueType["NumbersArray"] = "NUMBERS_ARRAY";
16020
16024
  DataPointValueType["String"] = "STRING";
16025
+ DataPointValueType["StringsArray"] = "STRINGS_ARRAY";
16021
16026
  DataPointValueType["Telephone"] = "TELEPHONE";
16022
16027
  })(exports.DataPointValueType || (exports.DataPointValueType = {}));
16023
16028
  exports.ElementStatus = void 0;
@@ -34604,10 +34609,10 @@ Check the top-level render call using <` + t + ">.");
34604
34609
  if (isSelected) {
34605
34610
  updatedSelected = selected.
34606
34611
  filter(function (item) {return item.value !== option.value;}).
34607
- sort(function (a, b) {return a.value - b.value;});
34612
+ sort();
34608
34613
  } else
34609
34614
  {
34610
- updatedSelected = __spreadArray(__spreadArray([], selected, true), [option], false).sort(function (a, b) {return a.value - b.value;});
34615
+ updatedSelected = __spreadArray(__spreadArray([], selected, true), [option], false).sort();
34611
34616
  }
34612
34617
  setSelected(updatedSelected);
34613
34618
  onChange(updatedSelected);
@@ -36863,10 +36868,14 @@ Check the top-level render call using <` + t + ">.");
36863
36868
  return jsxRuntime.exports.jsx(SingleChoiceQuestion, { label: question.title, options: [
36864
36869
  {
36865
36870
  id: "".concat(question.id, "-yes"),
36866
- value: 1,
36871
+ value: '1',
36867
36872
  label: labels.yes_label },
36868
36873
 
36869
- { id: "".concat(question.id, "-no"), value: 0, label: labels.no_label }],
36874
+ {
36875
+ id: "".concat(question.id, "-no"),
36876
+ value: '0',
36877
+ label: labels.no_label }],
36878
+
36870
36879
  onChange: function (data) {
36871
36880
  onChange(data);
36872
36881
  if (value !== data) {
@@ -37230,6 +37239,9 @@ Check the top-level render call using <` + t + ">.");
37230
37239
  if (typeof answer.value === 'boolean') {
37231
37240
  return answer.value ? '1' : '0';
37232
37241
  }
37242
+ if (typeof answer.value === 'string') {
37243
+ return "".concat(answer.value);
37244
+ }
37233
37245
  return JSON.stringify(answer === null || answer === void 0 ? void 0 : answer.value);
37234
37246
  };
37235
37247
  var convertToAwellInput = function (formResponse) {
@@ -3,7 +3,7 @@ import { type Option } from './types';
3
3
  export interface SelectProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
4
4
  type: 'single' | 'multiple';
5
5
  id: string;
6
- onChange: (value: number | Array<Option>) => void;
6
+ onChange: (value: number | Array<Option> | string) => void;
7
7
  onClick?: MouseEventHandler<HTMLInputElement>;
8
8
  mandatory?: boolean;
9
9
  options: Array<Option>;
@@ -7,6 +7,7 @@ export declare enum DataPointValueType {
7
7
  Date = "DATE",
8
8
  Number = "NUMBER",
9
9
  NumbersArray = "NUMBERS_ARRAY",
10
+ StringsArray = "STRINGS_ARRAY",
10
11
  String = "STRING"
11
12
  }
12
13
  export declare type QuestionRuleResult = {
@@ -1,11 +1,16 @@
1
1
  /// <reference types="react" />
2
- import { Option } from '../../types';
2
+ interface OptionStringOrNumberType {
3
+ id: string;
4
+ value: string | number;
5
+ label: string;
6
+ }
3
7
  export interface MultipleChoiceQuestionProps {
4
8
  questionId: string;
5
9
  label: string;
6
- options: Array<Option>;
7
- onChange: (newValue: Array<Option>) => void;
8
- values: Array<Option>;
10
+ options: Array<OptionStringOrNumberType>;
11
+ onChange: (newValue: Array<OptionStringOrNumberType>) => void;
12
+ values: Array<OptionStringOrNumberType>;
9
13
  mandatory?: boolean;
10
14
  }
11
15
  export declare const MultipleChoiceQuestion: ({ questionId, label, options, onChange, values, mandatory, }: MultipleChoiceQuestionProps) => JSX.Element;
16
+ export {};
@@ -1,12 +1,17 @@
1
1
  /// <reference types="react" />
2
- import { Option } from '../../types';
2
+ interface OptionStringOrNumberType {
3
+ id: string;
4
+ value: string | number;
5
+ label: string;
6
+ }
3
7
  export interface SingleChoiceQuestionProps {
4
8
  questionId: string;
5
9
  label: string;
6
- options: Array<Option>;
7
- value: Option | null;
8
- onChange: (newValue: Option | null) => void;
10
+ options: Array<OptionStringOrNumberType>;
11
+ value: OptionStringOrNumberType | null;
12
+ onChange: (newValue: OptionStringOrNumberType | null) => void;
9
13
  mandatory?: boolean;
10
14
  showFlickerOnSelected?: boolean;
11
15
  }
12
16
  export declare const SingleChoiceQuestion: ({ questionId, label, options, onChange, value, mandatory, showFlickerOnSelected, }: SingleChoiceQuestionProps) => JSX.Element;
17
+ export {};
@@ -79,6 +79,7 @@ export declare enum ActivityAction {
79
79
  Delegated = "DELEGATED",
80
80
  Deliver = "DELIVER",
81
81
  Discarded = "DISCARDED",
82
+ Expired = "EXPIRED",
82
83
  Failed = "FAILED",
83
84
  FailedToSend = "FAILED_TO_SEND",
84
85
  Generated = "GENERATED",
@@ -134,6 +135,7 @@ export declare enum ActivityObjectType {
134
135
  User = "USER"
135
136
  }
136
137
  export declare enum ActivityResolution {
138
+ Expired = "EXPIRED",
137
139
  Failure = "FAILURE",
138
140
  Success = "SUCCESS"
139
141
  }
@@ -141,6 +143,7 @@ export declare enum ActivityStatus {
141
143
  Active = "ACTIVE",
142
144
  Canceled = "CANCELED",
143
145
  Done = "DONE",
146
+ Expired = "EXPIRED",
144
147
  Failed = "FAILED"
145
148
  }
146
149
  export declare type ActivitySubject = {
@@ -342,7 +345,8 @@ export declare enum ConditionOperandType {
342
345
  DataSource = "DATA_SOURCE",
343
346
  Number = "NUMBER",
344
347
  NumbersArray = "NUMBERS_ARRAY",
345
- String = "STRING"
348
+ String = "STRING",
349
+ StringsArray = "STRINGS_ARRAY"
346
350
  }
347
351
  export declare enum ConditionOperator {
348
352
  Contains = "CONTAINS",
@@ -428,6 +432,7 @@ export declare enum DataPointValueType {
428
432
  Number = "NUMBER",
429
433
  NumbersArray = "NUMBERS_ARRAY",
430
434
  String = "STRING",
435
+ StringsArray = "STRINGS_ARRAY",
431
436
  Telephone = "TELEPHONE"
432
437
  }
433
438
  export declare type DateFilter = {
@@ -596,11 +601,15 @@ export declare type Form = {
596
601
  id: Scalars['ID'];
597
602
  key: Scalars['String'];
598
603
  metadata?: Maybe<Scalars['String']>;
604
+ previous_answers?: Maybe<Array<PreviousAnswers>>;
599
605
  questions: Array<Question>;
600
606
  release_id: Scalars['String'];
601
607
  title: Scalars['String'];
602
608
  trademark?: Maybe<Scalars['String']>;
603
609
  };
610
+ export declare type FormPrevious_AnswersArgs = {
611
+ pathway_id: Scalars['String'];
612
+ };
604
613
  export declare enum FormDisplayMode {
605
614
  Conversational = "CONVERSATIONAL",
606
615
  Regular = "REGULAR"
@@ -650,6 +659,19 @@ export declare type GeneratedClinicalNoteNarrative = {
650
659
  key: Scalars['String'];
651
660
  title: Scalars['String'];
652
661
  };
662
+ export declare type HostedPagesLink = {
663
+ __typename?: 'HostedPagesLink';
664
+ id: Scalars['ID'];
665
+ pathway_id: Scalars['String'];
666
+ stakeholder_id?: Maybe<Scalars['String']>;
667
+ url?: Maybe<Scalars['String']>;
668
+ };
669
+ export declare type HostedPagesLinkPayload = Payload & {
670
+ __typename?: 'HostedPagesLinkPayload';
671
+ code: Scalars['String'];
672
+ hosted_pages_link?: Maybe<HostedPagesLink>;
673
+ success: Scalars['Boolean'];
674
+ };
653
675
  export declare type HostedSession = {
654
676
  __typename?: 'HostedSession';
655
677
  cancel_url?: Maybe<Scalars['String']>;
@@ -881,6 +903,7 @@ export declare type Option = {
881
903
  id: Scalars['ID'];
882
904
  label: Scalars['String'];
883
905
  value: Scalars['Float'];
906
+ value_string: Scalars['String'];
884
907
  };
885
908
  export declare type OrchestrationFact = {
886
909
  __typename?: 'OrchestrationFact';
@@ -1083,6 +1106,12 @@ export declare type PluginActionSettingsProperty = {
1083
1106
  label: Scalars['String'];
1084
1107
  value: Scalars['String'];
1085
1108
  };
1109
+ export declare type PreviousAnswers = {
1110
+ __typename?: 'PreviousAnswers';
1111
+ activity_id: Scalars['ID'];
1112
+ answers: Array<Answer>;
1113
+ date: Scalars['String'];
1114
+ };
1086
1115
  export declare type PublishedPathwayDefinition = {
1087
1116
  __typename?: 'PublishedPathwayDefinition';
1088
1117
  active_activities?: Maybe<Scalars['Float']>;
@@ -1134,6 +1163,7 @@ export declare type Query = {
1134
1163
  forms: FormsPayload;
1135
1164
  getOrchestrationFactsFromPrompt: OrchestrationFactsPromptPayload;
1136
1165
  getStatusForPublishedPathwayDefinitions: PublishedPathwayDefinitionsPayload;
1166
+ hostedPagesLink: HostedPagesLinkPayload;
1137
1167
  hostedSession: HostedSessionPayload;
1138
1168
  hostedSessionActivities: HostedSessionActivitiesPayload;
1139
1169
  message: MessagePayload;
@@ -1225,6 +1255,10 @@ export declare type QueryGetOrchestrationFactsFromPromptArgs = {
1225
1255
  pathway_id: Scalars['String'];
1226
1256
  prompt: Scalars['String'];
1227
1257
  };
1258
+ export declare type QueryHostedPagesLinkArgs = {
1259
+ pathway_id: Scalars['String'];
1260
+ stakeholder_id: Scalars['String'];
1261
+ };
1228
1262
  export declare type QueryHostedSessionActivitiesArgs = {
1229
1263
  only_stakeholder_activities?: InputMaybe<Scalars['Boolean']>;
1230
1264
  };
@@ -1609,6 +1643,7 @@ export declare type Subscription = {
1609
1643
  __typename?: 'Subscription';
1610
1644
  activityCompleted: Activity;
1611
1645
  activityCreated: Activity;
1646
+ activityExpired: Activity;
1612
1647
  activityUpdated: Activity;
1613
1648
  apiCallCreated: ApiCall;
1614
1649
  apiCallUpdated: ApiCall;
@@ -1618,6 +1653,7 @@ export declare type Subscription = {
1618
1653
  pathwayUpdated: Pathway;
1619
1654
  sessionActivityCompleted: Activity;
1620
1655
  sessionActivityCreated: Activity;
1656
+ sessionActivityExpired: Activity;
1621
1657
  sessionActivityUpdated: Activity;
1622
1658
  sessionCompleted: HostedSession;
1623
1659
  sessionExpired: HostedSession;
@@ -1632,6 +1668,10 @@ export declare type SubscriptionActivityCreatedArgs = {
1632
1668
  only_patient_activities?: InputMaybe<Scalars['Boolean']>;
1633
1669
  pathway_id?: InputMaybe<Scalars['String']>;
1634
1670
  };
1671
+ export declare type SubscriptionActivityExpiredArgs = {
1672
+ only_patient_activities?: InputMaybe<Scalars['Boolean']>;
1673
+ pathway_id?: InputMaybe<Scalars['String']>;
1674
+ };
1635
1675
  export declare type SubscriptionActivityUpdatedArgs = {
1636
1676
  only_patient_activities?: InputMaybe<Scalars['Boolean']>;
1637
1677
  pathway_id?: InputMaybe<Scalars['String']>;
@@ -1663,6 +1703,9 @@ export declare type SubscriptionSessionActivityCompletedArgs = {
1663
1703
  export declare type SubscriptionSessionActivityCreatedArgs = {
1664
1704
  only_stakeholder_activities?: InputMaybe<Scalars['Boolean']>;
1665
1705
  };
1706
+ export declare type SubscriptionSessionActivityExpiredArgs = {
1707
+ only_stakeholder_activities?: InputMaybe<Scalars['Boolean']>;
1708
+ };
1666
1709
  export declare type SubscriptionSessionActivityUpdatedArgs = {
1667
1710
  only_stakeholder_activities?: InputMaybe<Scalars['Boolean']>;
1668
1711
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/ui-library",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "private": false,
5
5
  "description": "UI components to integrate with Awell Health",
6
6
  "repository": {
@@ -193,4 +193,4 @@
193
193
  ]
194
194
  },
195
195
  "homepage": "https://github.com/awell-health/ui-library#readme"
196
- }
196
+ }