Performs the $assemble operation for modular forms from the HL7 FHIR SDC (Structured Data Capture) specification: http://hl7.org/fhir/uv/sdc/modular.html
npm install @aehrc/sdc-assembleA Typescript reference implementation of the $assemble operation from the HL7 FHIR Structured Data Capture Specification and is designed for Modular Questionnaires.
``InputParameters` - Input parameters for the $assemble operation
`ts`
{
resourceType: 'Parameters'
parameter: [
{
name: 'questionnaire',
resource: YOUR_QUESTIONNAIRE_RESOURCE
}
]
}
`FetchQuestionnaireCallback` - A callback to fetch resources from your FHIR server
`ts${endpoint}/Questionnaire?url=${canonicalUrl}
function fetchQuestionnaireCallback (canonicalUrl: string, requestConfig: any) {
const { endpoint, token } = requestConfig;
return axios.get(, {Bearer ${token}
method: 'GET',
headers: { Accept: 'application/json+fhir; charset=utf-8', Authorization: , }`
});
};
Both of these interfaces are required to be implemented as arguments to the `assemble()` function.
To compile the code, use npm run compile.npm run watch
To watch for changes, use .
Note: Do not use tsc or tsc -w` as it will only compile to ES Modules, which means it will not work with CommonJS-based implementations.
A sample implementation can be found here