From 0767f5e256a91e432ebe52509314e91cbf33e248 Mon Sep 17 00:00:00 2001 From: Sean Fong Date: Fri, 5 Jul 2024 15:02:32 +0930 Subject: [PATCH] Add sdc-assemble typedoc API to docs --- .../api/sdc-assemble/functions/assemble.md | 19 + .../functions/isInputParameters.md | 21 + documentation/docs/api/sdc-assemble/index.md | 17 + .../interfaces/FetchQuestionnaireCallback.md | 49 + .../interfaces/InputParameters.md | 111 +++ .../interfaces/OutcomeParameter.md | 849 ++++++++++++++++++ .../interfaces/OutputParameters.md | 111 +++ .../docs/api/sdc-assemble/typedoc-sidebar.cjs | 47 + documentation/docs/index.md | 2 +- documentation/docusaurus.config.ts | 21 + .../src/interfaces/callback.interface.ts | 27 +- .../src/interfaces/parameters.interface.ts | 6 + 12 files changed, 1274 insertions(+), 6 deletions(-) create mode 100644 documentation/docs/api/sdc-assemble/functions/assemble.md create mode 100644 documentation/docs/api/sdc-assemble/functions/isInputParameters.md create mode 100644 documentation/docs/api/sdc-assemble/index.md create mode 100644 documentation/docs/api/sdc-assemble/interfaces/FetchQuestionnaireCallback.md create mode 100644 documentation/docs/api/sdc-assemble/interfaces/InputParameters.md create mode 100644 documentation/docs/api/sdc-assemble/interfaces/OutcomeParameter.md create mode 100644 documentation/docs/api/sdc-assemble/interfaces/OutputParameters.md create mode 100644 documentation/docs/api/sdc-assemble/typedoc-sidebar.cjs diff --git a/documentation/docs/api/sdc-assemble/functions/assemble.md b/documentation/docs/api/sdc-assemble/functions/assemble.md new file mode 100644 index 000000000..7cd85cc55 --- /dev/null +++ b/documentation/docs/api/sdc-assemble/functions/assemble.md @@ -0,0 +1,19 @@ +# Function: assemble() + +> **assemble**(`parameters`, `fetchQuestionnaireCallback`, `fetchQuestionnaireRequestConfig`): `Promise`\<`Questionnaire` \| `OperationOutcome` \| [`OutputParameters`](../interfaces/OutputParameters.md)\> + +The $assemble operation - https://build.fhir.org/ig/HL7/sdc/OperationDefinition-Questionnaire-assemble.html + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `parameters` | [`InputParameters`](../interfaces/InputParameters.md) | The input parameters for $assemble | +| `fetchQuestionnaireCallback` | [`FetchQuestionnaireCallback`](../interfaces/FetchQuestionnaireCallback.md) | A callback function defined by the implementer to fetch Questionnaire resources by a canonical url | +| `fetchQuestionnaireRequestConfig` | `any` | A request configuration object to be passed to the callback function | + +## Returns + +`Promise`\<`Questionnaire` \| `OperationOutcome` \| [`OutputParameters`](../interfaces/OutputParameters.md)\> + +A fully assembled questionnaire, an operationOutcome error(if present) or both (if there are warnings) diff --git a/documentation/docs/api/sdc-assemble/functions/isInputParameters.md b/documentation/docs/api/sdc-assemble/functions/isInputParameters.md new file mode 100644 index 000000000..77aaaef87 --- /dev/null +++ b/documentation/docs/api/sdc-assemble/functions/isInputParameters.md @@ -0,0 +1,21 @@ +# Function: isInputParameters() + +> **isInputParameters**(`parameters`): `parameters is InputParameters` + +Check if the given parameters is a valid InputParameters for $assemble + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `parameters` | `Parameters` | a given Parameters resource | + +## Returns + +`parameters is InputParameters` + +boolean value of whether the given parameters is InputParameters + +## See + +[http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble](http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble) diff --git a/documentation/docs/api/sdc-assemble/index.md b/documentation/docs/api/sdc-assemble/index.md new file mode 100644 index 000000000..4a80bb1a6 --- /dev/null +++ b/documentation/docs/api/sdc-assemble/index.md @@ -0,0 +1,17 @@ +# @aehrc/sdc-assemble + +## Interfaces + +| Interface | Description | +| :------ | :------ | +| [FetchQuestionnaireCallback](interfaces/FetchQuestionnaireCallback.md) | - | +| [InputParameters](interfaces/InputParameters.md) | Input parameters for the $assemble operation | +| [OutcomeParameter](interfaces/OutcomeParameter.md) | Output parameter from $assemble's 'outcome' parameter | +| [OutputParameters](interfaces/OutputParameters.md) | Output parameters for the $assemble operation | + +## Functions + +| Function | Description | +| :------ | :------ | +| [assemble](functions/assemble.md) | The $assemble operation - https://build.fhir.org/ig/HL7/sdc/OperationDefinition-Questionnaire-assemble.html | +| [isInputParameters](functions/isInputParameters.md) | Check if the given parameters is a valid InputParameters for $assemble | diff --git a/documentation/docs/api/sdc-assemble/interfaces/FetchQuestionnaireCallback.md b/documentation/docs/api/sdc-assemble/interfaces/FetchQuestionnaireCallback.md new file mode 100644 index 000000000..9694dd20d --- /dev/null +++ b/documentation/docs/api/sdc-assemble/interfaces/FetchQuestionnaireCallback.md @@ -0,0 +1,49 @@ +# Interface: FetchQuestionnaireCallback() + +To define a method to fetch Questionnaire resources from the FHIR server with the given canonical URL + +## See + +[https://www.hl7.org/fhir/questionnaire.html](https://www.hl7.org/fhir/questionnaire.html) + +## Example + +```ts +const fetchQuestionnaireCallback: FetchQuestionnaireCallback = async ( + canonicalUrl: string, + requestConfig: {url: string, authToken?: string} +) => { + const { url, authToken } = requestConfig; + + let requestUrl = url; + if (!requestUrl.endsWith('/')) { + requestUrl += '/'; + } + requestUrl += `Questionnaire?url=${canonicalUrl}`; + + const headers = authToken ? { ...HEADERS, Authorization: `Bearer ${authToken}` } : HEADERS; + + const response = await fetch(requestUrl, { + headers: headers + }); + + if (!response.ok) { + throw new Error(`HTTP error when performing ${requestUrl}. Status: ${response.status}`); + } + + return response.json(); +}; +``` + +> **FetchQuestionnaireCallback**(`canonicalUrl`, `requestConfig`?): `Promise`\<`any`\> + +## Parameters + +| Parameter | Type | +| :------ | :------ | +| `canonicalUrl` | `string` | +| `requestConfig`? | `any` | + +## Returns + +`Promise`\<`any`\> diff --git a/documentation/docs/api/sdc-assemble/interfaces/InputParameters.md b/documentation/docs/api/sdc-assemble/interfaces/InputParameters.md new file mode 100644 index 000000000..2205c2641 --- /dev/null +++ b/documentation/docs/api/sdc-assemble/interfaces/InputParameters.md @@ -0,0 +1,111 @@ +# Interface: InputParameters + +Input parameters for the $assemble operation + +## See + +[http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble](http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble) + +## Extends + +- `Parameters` + +## Properties + +### \_id? + +> `optional` **\_id**: `Element` + +#### Inherited from + +`Parameters._id` + +*** + +### \_implicitRules? + +> `optional` **\_implicitRules**: `Element` + +#### Inherited from + +`Parameters._implicitRules` + +*** + +### \_language? + +> `optional` **\_language**: `Element` + +#### Inherited from + +`Parameters._language` + +*** + +### id? + +> `optional` **id**: `string` + +The only time that a resource does not have an id is when it is being submitted to the server using a create operation. + +#### Inherited from + +`Parameters.id` + +*** + +### implicitRules? + +> `optional` **implicitRules**: `string` + +Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc. + +#### Inherited from + +`Parameters.implicitRules` + +*** + +### language? + +> `optional` **language**: `string` + +Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute). + +#### Inherited from + +`Parameters.language` + +*** + +### meta? + +> `optional` **meta**: `Meta` + +The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. + +#### Inherited from + +`Parameters.meta` + +*** + +### parameter + +> **parameter**: [`object`] + +#### Overrides + +`Parameters.parameter` + +*** + +### resourceType + +> `readonly` **resourceType**: `"Parameters"` + +Resource Type Name (for serialization) + +#### Inherited from + +`Parameters.resourceType` diff --git a/documentation/docs/api/sdc-assemble/interfaces/OutcomeParameter.md b/documentation/docs/api/sdc-assemble/interfaces/OutcomeParameter.md new file mode 100644 index 000000000..af972b7d5 --- /dev/null +++ b/documentation/docs/api/sdc-assemble/interfaces/OutcomeParameter.md @@ -0,0 +1,849 @@ +# Interface: OutcomeParameter + +Output parameter from $assemble's 'outcome' parameter + +## See + +[http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble](http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble) + +## Extends + +- `ParametersParameter` + +## Properties + +### \_id? + +> `optional` **\_id**: `Element` + +#### Inherited from + +`ParametersParameter._id` + +*** + +### \_name? + +> `optional` **\_name**: `Element` + +#### Inherited from + +`ParametersParameter._name` + +*** + +### \_valueBase64Binary? + +> `optional` **\_valueBase64Binary**: `Element` + +#### Inherited from + +`ParametersParameter._valueBase64Binary` + +*** + +### \_valueBoolean? + +> `optional` **\_valueBoolean**: `Element` + +#### Inherited from + +`ParametersParameter._valueBoolean` + +*** + +### \_valueCanonical? + +> `optional` **\_valueCanonical**: `Element` + +#### Inherited from + +`ParametersParameter._valueCanonical` + +*** + +### \_valueCode? + +> `optional` **\_valueCode**: `Element` + +#### Inherited from + +`ParametersParameter._valueCode` + +*** + +### \_valueDate? + +> `optional` **\_valueDate**: `Element` + +#### Inherited from + +`ParametersParameter._valueDate` + +*** + +### \_valueDateTime? + +> `optional` **\_valueDateTime**: `Element` + +#### Inherited from + +`ParametersParameter._valueDateTime` + +*** + +### \_valueId? + +> `optional` **\_valueId**: `Element` + +#### Inherited from + +`ParametersParameter._valueId` + +*** + +### \_valueInstant? + +> `optional` **\_valueInstant**: `Element` + +#### Inherited from + +`ParametersParameter._valueInstant` + +*** + +### \_valueMarkdown? + +> `optional` **\_valueMarkdown**: `Element` + +#### Inherited from + +`ParametersParameter._valueMarkdown` + +*** + +### \_valueOid? + +> `optional` **\_valueOid**: `Element` + +#### Inherited from + +`ParametersParameter._valueOid` + +*** + +### \_valueString? + +> `optional` **\_valueString**: `Element` + +#### Inherited from + +`ParametersParameter._valueString` + +*** + +### \_valueTime? + +> `optional` **\_valueTime**: `Element` + +#### Inherited from + +`ParametersParameter._valueTime` + +*** + +### \_valueUri? + +> `optional` **\_valueUri**: `Element` + +#### Inherited from + +`ParametersParameter._valueUri` + +*** + +### \_valueUrl? + +> `optional` **\_valueUrl**: `Element` + +#### Inherited from + +`ParametersParameter._valueUrl` + +*** + +### \_valueUuid? + +> `optional` **\_valueUuid**: `Element` + +#### Inherited from + +`ParametersParameter._valueUuid` + +*** + +### extension? + +> `optional` **extension**: `Extension`[] + +There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. + +#### Inherited from + +`ParametersParameter.extension` + +*** + +### id? + +> `optional` **id**: `string` + +Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces. + +#### Inherited from + +`ParametersParameter.id` + +*** + +### modifierExtension? + +> `optional` **modifierExtension**: `Extension`[] + +There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. + +#### Inherited from + +`ParametersParameter.modifierExtension` + +*** + +### name + +> **name**: `"outcome"` + +#### Overrides + +`ParametersParameter.name` + +*** + +### part? + +> `optional` **part**: `ParametersParameter`[] + +Only one level of nested parameters is allowed. + +#### Inherited from + +`ParametersParameter.part` + +*** + +### resource + +> **resource**: `OperationOutcome` + +#### Overrides + +`ParametersParameter.resource` + +*** + +### valueAddress? + +> `optional` **valueAddress**: `Address` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueAddress` + +*** + +### valueAge? + +> `optional` **valueAge**: `Age` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueAge` + +*** + +### valueAnnotation? + +> `optional` **valueAnnotation**: `Annotation` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueAnnotation` + +*** + +### valueAttachment? + +> `optional` **valueAttachment**: `Attachment` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueAttachment` + +*** + +### valueBase64Binary? + +> `optional` **valueBase64Binary**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueBase64Binary` + +*** + +### valueBoolean? + +> `optional` **valueBoolean**: `boolean` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueBoolean` + +*** + +### valueCanonical? + +> `optional` **valueCanonical**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueCanonical` + +*** + +### valueCode? + +> `optional` **valueCode**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueCode` + +*** + +### valueCodeableConcept? + +> `optional` **valueCodeableConcept**: `CodeableConcept` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueCodeableConcept` + +*** + +### valueCoding? + +> `optional` **valueCoding**: `Coding` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueCoding` + +*** + +### valueContactDetail? + +> `optional` **valueContactDetail**: `ContactDetail` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueContactDetail` + +*** + +### valueContactPoint? + +> `optional` **valueContactPoint**: `ContactPoint` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueContactPoint` + +*** + +### valueContributor? + +> `optional` **valueContributor**: `Contributor` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueContributor` + +*** + +### valueCount? + +> `optional` **valueCount**: `Count` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueCount` + +*** + +### valueDataRequirement? + +> `optional` **valueDataRequirement**: `DataRequirement` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDataRequirement` + +*** + +### valueDate? + +> `optional` **valueDate**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDate` + +*** + +### valueDateTime? + +> `optional` **valueDateTime**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDateTime` + +*** + +### valueDecimal? + +> `optional` **valueDecimal**: `number` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDecimal` + +*** + +### valueDistance? + +> `optional` **valueDistance**: `Distance` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDistance` + +*** + +### valueDosage? + +> `optional` **valueDosage**: `Dosage` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDosage` + +*** + +### valueDuration? + +> `optional` **valueDuration**: `Duration` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueDuration` + +*** + +### valueExpression? + +> `optional` **valueExpression**: `Expression` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueExpression` + +*** + +### valueHumanName? + +> `optional` **valueHumanName**: `HumanName` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueHumanName` + +*** + +### valueId? + +> `optional` **valueId**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueId` + +*** + +### valueIdentifier? + +> `optional` **valueIdentifier**: `Identifier` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueIdentifier` + +*** + +### valueInstant? + +> `optional` **valueInstant**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueInstant` + +*** + +### valueInteger? + +> `optional` **valueInteger**: `number` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueInteger` + +*** + +### valueMarkdown? + +> `optional` **valueMarkdown**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueMarkdown` + +*** + +### valueMeta? + +> `optional` **valueMeta**: `Meta` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueMeta` + +*** + +### valueMoney? + +> `optional` **valueMoney**: `Money` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueMoney` + +*** + +### valueOid? + +> `optional` **valueOid**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueOid` + +*** + +### valueParameterDefinition? + +> `optional` **valueParameterDefinition**: `ParameterDefinition` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueParameterDefinition` + +*** + +### valuePeriod? + +> `optional` **valuePeriod**: `Period` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valuePeriod` + +*** + +### valuePositiveInt? + +> `optional` **valuePositiveInt**: `number` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valuePositiveInt` + +*** + +### valueQuantity? + +> `optional` **valueQuantity**: `Quantity` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueQuantity` + +*** + +### valueRange? + +> `optional` **valueRange**: `Range` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueRange` + +*** + +### valueRatio? + +> `optional` **valueRatio**: `Ratio` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueRatio` + +*** + +### valueReference? + +> `optional` **valueReference**: `Reference` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueReference` + +*** + +### valueRelatedArtifact? + +> `optional` **valueRelatedArtifact**: `RelatedArtifact` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueRelatedArtifact` + +*** + +### valueSampledData? + +> `optional` **valueSampledData**: `SampledData` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueSampledData` + +*** + +### valueSignature? + +> `optional` **valueSignature**: `Signature` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueSignature` + +*** + +### valueString? + +> `optional` **valueString**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueString` + +*** + +### valueTime? + +> `optional` **valueTime**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueTime` + +*** + +### valueTiming? + +> `optional` **valueTiming**: `Timing` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueTiming` + +*** + +### valueTriggerDefinition? + +> `optional` **valueTriggerDefinition**: `TriggerDefinition` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueTriggerDefinition` + +*** + +### valueUnsignedInt? + +> `optional` **valueUnsignedInt**: `number` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueUnsignedInt` + +*** + +### valueUri? + +> `optional` **valueUri**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueUri` + +*** + +### valueUrl? + +> `optional` **valueUrl**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueUrl` + +*** + +### valueUsageContext? + +> `optional` **valueUsageContext**: `UsageContext` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueUsageContext` + +*** + +### valueUuid? + +> `optional` **valueUuid**: `string` + +If the parameter is a data type. + +#### Inherited from + +`ParametersParameter.valueUuid` diff --git a/documentation/docs/api/sdc-assemble/interfaces/OutputParameters.md b/documentation/docs/api/sdc-assemble/interfaces/OutputParameters.md new file mode 100644 index 000000000..6189cce7c --- /dev/null +++ b/documentation/docs/api/sdc-assemble/interfaces/OutputParameters.md @@ -0,0 +1,111 @@ +# Interface: OutputParameters + +Output parameters for the $assemble operation + +## See + +[http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble](http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble) + +## Extends + +- `Parameters` + +## Properties + +### \_id? + +> `optional` **\_id**: `Element` + +#### Inherited from + +`Parameters._id` + +*** + +### \_implicitRules? + +> `optional` **\_implicitRules**: `Element` + +#### Inherited from + +`Parameters._implicitRules` + +*** + +### \_language? + +> `optional` **\_language**: `Element` + +#### Inherited from + +`Parameters._language` + +*** + +### id? + +> `optional` **id**: `string` + +The only time that a resource does not have an id is when it is being submitted to the server using a create operation. + +#### Inherited from + +`Parameters.id` + +*** + +### implicitRules? + +> `optional` **implicitRules**: `string` + +Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc. + +#### Inherited from + +`Parameters.implicitRules` + +*** + +### language? + +> `optional` **language**: `string` + +Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute). + +#### Inherited from + +`Parameters.language` + +*** + +### meta? + +> `optional` **meta**: `Meta` + +The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. + +#### Inherited from + +`Parameters.meta` + +*** + +### parameter + +> **parameter**: [`ReturnParameter`, [`OutcomeParameter`](OutcomeParameter.md)] + +#### Overrides + +`Parameters.parameter` + +*** + +### resourceType + +> `readonly` **resourceType**: `"Parameters"` + +Resource Type Name (for serialization) + +#### Inherited from + +`Parameters.resourceType` diff --git a/documentation/docs/api/sdc-assemble/typedoc-sidebar.cjs b/documentation/docs/api/sdc-assemble/typedoc-sidebar.cjs new file mode 100644 index 000000000..956829b44 --- /dev/null +++ b/documentation/docs/api/sdc-assemble/typedoc-sidebar.cjs @@ -0,0 +1,47 @@ +// @ts-check +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const typedocSidebar = { items: [ + { + "type": "category", + "label": "Interfaces", + "items": [ + { + "type": "doc", + "id": "api/sdc-assemble/interfaces/FetchQuestionnaireCallback", + "label": "FetchQuestionnaireCallback" + }, + { + "type": "doc", + "id": "api/sdc-assemble/interfaces/InputParameters", + "label": "InputParameters" + }, + { + "type": "doc", + "id": "api/sdc-assemble/interfaces/OutcomeParameter", + "label": "OutcomeParameter" + }, + { + "type": "doc", + "id": "api/sdc-assemble/interfaces/OutputParameters", + "label": "OutputParameters" + } + ] + }, + { + "type": "category", + "label": "Functions", + "items": [ + { + "type": "doc", + "id": "api/sdc-assemble/functions/assemble", + "label": "assemble" + }, + { + "type": "doc", + "id": "api/sdc-assemble/functions/isInputParameters", + "label": "isInputParameters" + } + ] + } +]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/documentation/docs/index.md b/documentation/docs/index.md index c59e2171b..9dd5222ba 100644 --- a/documentation/docs/index.md +++ b/documentation/docs/index.md @@ -13,7 +13,7 @@ It is intended to demonstrate the use of [HL7 FHIR](https://hl7.org/fhir/) speci This documentation is intended to provide a guide on how to use Smart Forms. It is divided into the following sections: - [Components](/docs/components): A showcase of supported Questionnaire form components. - [SDC](/docs/sdc): A section around the conformance and usage of functionalities defined in the SDC specification. -- [Developer Usage](/docs/devUsage): A guide on how to use the form renderer in your own application. +- [Developer Usage](/docs/dev): A guide on how to use the form renderer in your own application. ### Referenced FHIR Specifications diff --git a/documentation/docusaurus.config.ts b/documentation/docusaurus.config.ts index fbe558337..6c75a530b 100644 --- a/documentation/docusaurus.config.ts +++ b/documentation/docusaurus.config.ts @@ -209,6 +209,27 @@ const config: Config = { enumMembersFormat: 'table', readme: 'none' } + ], + [ + 'docusaurus-plugin-typedoc', + // Options + { + id: 'sdc-assemble', + entryPoints: '../packages/sdc-assemble/src/index.ts', + tsconfig: '../packages/sdc-assemble/tsconfig.json', + out: 'docs/api/sdc-assemble', + excludeTags: ['@author'], + sidebar: { + autoConfiguration: true, + pretty: true + }, + plugin: ['typedoc-plugin-frontmatter'], + indexFormat: 'table', + disableSources: true, + parametersFormat: 'table', + enumMembersFormat: 'table', + readme: 'none' + } ] ] }; diff --git a/packages/sdc-assemble/src/interfaces/callback.interface.ts b/packages/sdc-assemble/src/interfaces/callback.interface.ts index eb850dda0..7d96e9789 100644 --- a/packages/sdc-assemble/src/interfaces/callback.interface.ts +++ b/packages/sdc-assemble/src/interfaces/callback.interface.ts @@ -24,12 +24,29 @@ * @returns A promise of the Questionnaire Bundle resource (or an error)! * * @example - * const fetchQuestionnaireCallback: FetchQuestionnaireCallback = (canonicalUrl: string, requestConfig: any) => { - * const { endpoint, token } = requestConfig; - * return axios.get(`${endpoint}/Questionnaire?url=${canonicalUrl}`, { - * method: 'GET', - * headers: { Accept: 'application/json;charset=utf-8', Authorization: `Bearer ${token}`, } + * const fetchQuestionnaireCallback: FetchQuestionnaireCallback = async ( + * canonicalUrl: string, + * requestConfig: {url: string, authToken?: string} + * ) => { + * const { url, authToken } = requestConfig; + * + * let requestUrl = url; + * if (!requestUrl.endsWith('/')) { + * requestUrl += '/'; + * } + * requestUrl += `Questionnaire?url=${canonicalUrl}`; + * + * const headers = authToken ? { ...HEADERS, Authorization: `Bearer ${authToken}` } : HEADERS; + * + * const response = await fetch(requestUrl, { + * headers: headers * }); + * + * if (!response.ok) { + * throw new Error(`HTTP error when performing ${requestUrl}. Status: ${response.status}`); + * } + * + * return response.json(); * }; * * @author Sean Fong diff --git a/packages/sdc-assemble/src/interfaces/parameters.interface.ts b/packages/sdc-assemble/src/interfaces/parameters.interface.ts index 50a8c512f..1903bbca2 100644 --- a/packages/sdc-assemble/src/interfaces/parameters.interface.ts +++ b/packages/sdc-assemble/src/interfaces/parameters.interface.ts @@ -47,6 +47,12 @@ interface ReturnParameter extends ParametersParameter { resource: Questionnaire; } +/** + * Output parameter from $assemble's 'outcome' parameter + * @see {@link http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble} + * + * @author Sean Fong + */ export interface OutcomeParameter extends ParametersParameter { name: 'outcome'; resource: OperationOutcome;