Update CR Operation Providers to latest version of CR release (#5751)

* Add support for latest version of CR and new $questionnaire operation

* Fix formatting in javadoc causing warning

* Update to 3.0.0 CR release

* Add support for expected parameter names from updated IG's

* Update Clinical Reasoning documentation

* Update pom.xml

* Create 5750-update-cr-operations.yaml

* fix doc

* Update to latest CR version

* Update pom.xml

* In version

* Update changelog

* Remove commented code
This commit is contained in:
Brenin Rhodes 2024-03-28 12:44:29 -06:00 committed by GitHub
parent 6175807f58
commit 9ddd8bf4d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
123 changed files with 1113 additions and 526 deletions

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-bom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<packaging>pom</packaging>
<name>HAPI FHIR BOM</name>
@ -12,7 +12,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -0,0 +1,12 @@
---
type: add
issue: 5750
title: "Update to the 3.2.0 release of the Clinical Reasoning Module. This includes the following changes:
<ul>
<li>Updated the Clinical Reasoning documentation.</li>
<li>Added support for additional parameters on operations.</li>
<li>Added StructureDefinition/$questionnaire operation.</li>
<li>Add ability to generate PlanDefinition/$apply results with unique ids.</li>
<li>Resolved issues with Questionnaire item generation during PlanDefinition/$apply.</li>
<li>Resolved issues with some request resources not generated correctly from ActivityDefinition/$apply</li>
</ul>"

View File

@ -0,0 +1,48 @@
# ActivityDefinition
## Introduction
The FHIR Clinical Reasoning Module defines the [ActivityDefinition resource](https://www.hl7.org/fhir/activitydefinition.html) and several [associated operations](https://www.hl7.org/fhir/activitydefinition-operations.html). An ActivityDefinition is a shareable, consumable description of some activity to be performed. It may be used to specify actions to be taken as part of a workflow, order set, or protocol, or it may be used independently as part of a catalog of activities such as orderables.
In general, an activity definition is simply a conceptual description of some specific action that should be taken. An instance of an ActivityDefinition does not indicate that any action has been performed (as an event resource does), nor does it indicate the actual intent to carry out any particular action (as a request resource does). Instead, an activity definition provides a reusable template that can be used to construct specific request resources such as ServiceRequest and MedicationRequest.
Note that this is conceptually similar to the Task resource as well, with the distinction being that ActivityDefinition represents the description of a task in the abstract, while the Task resource is used to track a specific instance of a task as it moves through the steps of a workflow.
An ActivityDefinition resource provides a description, or template, of an action to perform. These actions can be purely text-based descriptions of the action to be performed, only interpretable by a human user, or they can be structured definitions with enough information to construct a resource to represent the request or activity directly. This process of converting the ActivityDefinition into a specific resource in a particular context is performed with the [$apply](/docs/clinical_reasoning/activity_definitions.html#apply) operation.
## Operations
HAPI implements the following operations for ActivityDefinitions
* [$apply](/docs/clinical_reasoning/activity_definitions.html#apply)
## Apply
The `ActivityDefinition/$apply` [operation](https://www.hl7.org/fhir/activitydefinition-operation-apply.html) creates a [Request Resource](https://www.hl7.org/fhir/workflow.html#request) for a given context. This implementation follows the [FHIR Specification](https://www.hl7.org/fhir/activitydefinition.html#12.22.4.3) and supports the [FHIR Clinical Guidelines IG](http://hl7.org/fhir/uv/cpg/index.html).
### Parameters
The following parameters are supported for the `ActivityDefinition/$apply` operation:
| Parameter | Type | Description |
|---------------------|---------------------------|-------------|
| activityDefinition | ActivityDefinition | The activity definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required, or a url (and optionally version) must be supplied. |
| canonical | canonical(ActivityDefinition) | The canonical url of the activity definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the activityDefinition parameter must be supplied. |
| url | uri | Canonical URL of the ActivityDefinition when invoked at the resource type level. This is exclusive with the activityDefinition and canonical parameters. |
| version | string | Version of the ActivityDefinition when invoked at the resource type level. This is exclusive with the activityDefinition and canonical parameters. |
| subject | string(reference) | The subject(s) that is/are the target of the activity definition to be applied. |
| encounter | string(reference) | The encounter in context, if any. |
| practitioner | string(reference) | The practitioner applying the activity definition. |
| organization | string(reference) | The organization applying the activity definition. |
| userType | CodeableConcept | The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.) |
| userLanguage | CodeableConcept | Preferred language of the person using the system |
| userTaskContext | CodeableConcept | The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources. |
| setting | CodeableConcept | The current setting of the request (inpatient, outpatient, etc.). |
| settingContext | CodeableConcept | Additional detail about the setting of the request, if any |
| parameters | Parameters | Any input parameters defined in libraries referenced by the ActivityDefinition. |
| useServerData | boolean | Whether to use data from the server performing the evaluation. If this parameter is true (the default), then the operation will use data first from any bundles provided as parameters (through the data and prefetch parameters), second data from the server performing the operation, and third, data from the dataEndpoint parameter (if provided). If this parameter is false, the operation will use data first from the bundles provided in the data or prefetch parameters, and second from the dataEndpoint parameter (if provided). |
| data | Bundle | Data to be made available to the ActivityDefinition evaluation. |
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the ActivityDefinition. |
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the ActivityDefinition. |
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the ActivityDefinition. |

View File

@ -18,6 +18,7 @@ There are additional IGs outside the FHIR CR module that define further requirem
* [Structured Data Capture IG](https://build.fhir.org/ig/HL7/sdc/)
* [Clinical Guidelines IG](https://hl7.org/fhir/uv/cpg/)
* [Quality Measures IG](http://hl7.org/fhir/us/cqfmeasures/)
* [Canonical Resource Management Infrastructure IG](https://build.fhir.org/ig/HL7/crmi-ig/index.html)
## HAPI FHIR

View File

@ -13,6 +13,75 @@ The process of applying a PlanDefinition to a particular context typically produ
Each ActivityDefinition is used to construct a specific resource, based on the definition of the activity and combined with contextual information for the particular patient that the plan definition is being applied to.
## Operations
HAPI implements the following operations for PlanDefinitions:
* [$apply](/docs/clinical_reasoning/plan_definitions.html#apply)
* [$package](/docs/clinical_reasoning/plan_definitions.html#package)
## Apply
The `PlanDefinition/$apply` [operation](https://www.hl7.org/fhir/plandefinition-operation-apply.html) applies a PlanDefinition to a given context. This implementation follows the [FHIR Specification](https://www.hl7.org/fhir/plandefinition.html#12.23.4.3) and supports the [FHIR Clinical Guidelines IG](http://hl7.org/fhir/uv/cpg/index.html). In addition, an R5 version of apply is made available for R4 instances. This will cause $apply to return a Bundle of resources instead of a CarePlan. This can be invoked with `$r5.apply`.
Some example PlanDefinition workflows are available in the [opioid-cds-r4](https://github.com/cqframework/opioid-cds-r4) IG. Full Bundles with all the required supporting resources are available [here](https://github.com/cqframework/opioid-cds-r4/tree/1e543f781138f3d85404b7f65a92ff713519ef2c/bundles). You can download a Bundle and load it on your server as a transaction:
```bash
POST http://your-server-base/fhir opioidcds-10-patient-view-bundle.json
```
These Bundles do not include example Patient clinical data. Applying a PlanDefinition can be invoked with:
```bash
GET http://your-server-base/fhir/PlanDefinition/opioidcds-10-patient-view/$apply?subject=Patient/patientId&encounter=Encounter/encounterId&practitioner=Practitioner/practitionerId
```
### Parameters
The following parameters are supported for the `PlanDefinition/$apply` and `PlanDefinition/$r5.apply` operation:
| Parameter | Type | Description |
|---------------------|---------------------------|-------------|
| planDefinition | PlanDefinition | The plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required, or a url (and optionally version) must be supplied. |
| canonical | canonical(PlanDefinition) | The canonical url of the plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the planDefinition parameter must be supplied. |
| url | uri | Canonical URL of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters. |
| version | string | Version of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters. |
| subject | string(reference) | The subject(s) that is/are the target of the plan definition to be applied. |
| encounter | string(reference) | The encounter in context, if any. |
| practitioner | string(reference) | The practitioner applying the plan definition. |
| organization | string(reference) | The organization applying the plan definition. |
| userType | CodeableConcept | The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.) |
| userLanguage | CodeableConcept | Preferred language of the person using the system |
| userTaskContext | CodeableConcept | The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources. |
| setting | CodeableConcept | The current setting of the request (inpatient, outpatient, etc.). |
| settingContext | CodeableConcept | Additional detail about the setting of the request, if any |
| parameters | Parameters | Any input parameters defined in libraries referenced by the PlanDefinition. |
| useServerData | boolean | Whether to use data from the server performing the evaluation. If this parameter is true (the default), then the operation will use data first from any bundles provided as parameters (through the data and prefetch parameters), second data from the server performing the operation, and third, data from the dataEndpoint parameter (if provided). If this parameter is false, the operation will use data first from the bundles provided in the data or prefetch parameters, and second from the dataEndpoint parameter (if provided). |
| data | Bundle | Data to be made available to the PlanDefinition evaluation. |
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the PlanDefinition. |
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the PlanDefinition. |
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the PlanDefinition. |
## Package
The `PlanDefinition/$package` [operation](https://build.fhir.org/ig/HL7/crmi-ig/OperationDefinition-crmi-package.html) for PlanDefinition will generate a Bundle of resources that includes the PlanDefinition as well as any related resources which can then be shared. This implementation follows the [CRMI IG](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/index.html) guidance for [packaging artifacts](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html).
### Parameters
The following parameters are supported for the `PlanDefinition/$package` operation:
| Parameter | Type | Description |
|-----------|-----------|-------------|
| id | string | The logical id of an existing Resource to package on the server. |
| canonical | canonical | A canonical url (optionally version specific) of a Resource to package on the server. |
| url | uri | A canonical or artifact reference to a Resource to package on the server. This is exclusive with the canonical parameter. |
| version | string | The version of the Resource. This is exclusive with the canonical parameter. |
| usePut | boolean | Determines the type of method returned in the Bundle Entries: POST if False (the default), PUT if True. |
## Example PlanDefinition
```json
{
"resourceType": "PlanDefinition",
@ -223,48 +292,3 @@ Each ActivityDefinition is used to construct a specific resource, based on the d
]
}
```
## Operations
HAPI implements the [$apply](http://hl7.org/fhir/uv/cpg/OperationDefinition-cpg-plandefinition-apply.html) operation. Support for additional operations is planned.
## Apply
The `$apply` operation applies a PlanDefinition to a given context. This implementation follows the [FHIR Specification](https://www.hl7.org/fhir/plandefinition.html#12.23.4.3) and supports the [FHIR Clinical Guidelines IG](http://hl7.org/fhir/uv/cpg/index.html). In addition, an R5 version of apply is made available for R4 instances. This will cause $apply to return a Bundle of resources instead of a CarePlan. This can be invoked with `$r5.apply`.
### Example PlanDefinition
Some example PlanDefinition workflows are available in the [opioid-cds-r4](https://github.com/cqframework/opioid-cds-r4) IG. Full Bundles with all the required supporting resources are available [here](https://github.com/cqframework/opioid-cds-r4/tree/1e543f781138f3d85404b7f65a92ff713519ef2c/bundles). You can download a Bundle and load it on your server as a transaction:
```bash
POST http://your-server-base/fhir opioidcds-10-patient-view-bundle.json
```
These Bundles do not include example Patient clinical data. Applying a PlanDefinition can be invoked with:
```bash
GET http://your-server-base/fhir/PlanDefinition/opioidcds-10-patient-view/$apply?subject=Patient/patientId&encounter=Encounter/encounterId&practitioner=Practitioner/practitionerId
```
### Additional Parameters
The following additional parameters are supported for the `$apply` and `$r5.apply` operation:
| Parameter | Type | Description |
|-----------|------------|-------------|
| organization | String | The organization in context |
| userType | String | The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.) |
| userLanguage | String | Preferred language of the person using the system |
| userTaskContext | String | The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources |
| setting | String | The current setting of the request (inpatient, outpatient, etc.) |
| settingContext | String | Additional detail about the setting of the request, if any |
| parameters | Parameters | Any input parameters defined in libraries referenced by the PlanDefinition. |
| data | Bundle | Data to be made available to the PlanDefinition evaluation. |
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the PlanDefinition. |
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the PlanDefinition. |
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the PlanDefinition. |
## Package
The `package` operation for [PlanDefinition](https://www.hl7.org/fhir/plandefinition.html) will generate a Bundle of resources that includes the PlanDefinition as well as any related resources which can then be shared. This implementation follows the [CRMI IG](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/index.html) guidance for [packaging artifacts](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html).

View File

@ -10,17 +10,96 @@ In addition to its use as a means for capturing data, Questionnaires can also be
## Operations
HAPI implements the following operations from the [Structured Data Capture IG](https://hl7.org/fhir/uv/sdc/index.html)
* [$populate](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html)
* [$extract](http://hl7.org/fhir/uv/sdc/OperationDefinition-QuestionnaireResponse-extract.html)
HAPI implements the following operations for Questionnaires and QuestionnaireResponses:
Support for additional operations is planned.
* [$questionnaire](/docs/clinical_reasoning/questionnaires.html#questionnaire)
* [$populate](/docs/clinical_reasoning/questionnaires.html#populate)
* [$extract](/docs/clinical_reasoning/questionnaires.html#extract)
* [$package](/docs/clinical_reasoning/questionnaires.html#package)
## Questionnaire
The `StructureDefinition/$questionnaire` [operation]() generates a [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) from a given [StructureDefinition](https://www.hl7.org/fhir/structuredefinition.html). A question will be created for each core element or extension element found in the StructureDefinition.
### Parameters
The following parameters are supported for the `StructureDefinition/$questionnaire` operation:
| Parameter | Type | Description |
|-----------|------|-------------|
| profile | StructureDefinition | The StructureDefinition to base the Questionnaire on. Used when the operation is invoked at the 'type' level. |
| canonical | canonical | The canonical identifier for the StructureDefinition (optionally version-specific). |
| url | uri | Canonical URL of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters. |
| version | string | Version of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters. |
| supportedOnly | boolean | If true (default: false), the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition. |
| requiredOnly | boolean | If true (default: false), the questionnaire will only include those elements marked as "min>0" in the StructureDefinition. |
| subject | string | The subject(s) that is/are the target of the Questionnaire. |
| parameters | Parameters | Any input parameters defined in libraries referenced by the StructureDefinition. |
| useServerData | boolean Whether to use data from the server performing the evaluation. |
| data | Bundle | Data to be made available during CQL evaluation. |
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the StructureDefinition. |
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the StructureDefinition. |
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the StructureDefinition. |
## Populate
The `populate` operation generates a [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) based on a specific [Questionnaire](https://www.hl7.org/fhir/questionnaire.html), filling in answers to questions where possible based on information provided as part of the operation or already known by the server about the subject of the Questionnaire.
The `Questionnaire/$populate` [operation](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html) generates a [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) based on a specific [Questionnaire](https://www.hl7.org/fhir/questionnaire.html), filling in answers to questions where possible based on information provided as part of the operation or already known by the server about the subject of the Questionnaire.
### Example Questionnaire
### Parameters
The following parameters are supported for the `Questionnaire/$populate` operation:
| Parameter | Type | Description |
|-----------|------|-------------|
| questionnaire | Questionnaire | The Questionnaire to populate. Used when the operation is invoked at the 'type' level. |
| canonical | canonical | The canonical identifier for the Questionnaire (optionally version-specific). |
| url | uri | Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters. |
| version | string | Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters. |
| subject | string | The subject(s) that is/are the target of the Questionnaire. |
| parameters | Parameters | Any input parameters defined in libraries referenced by the Questionnaire. |
| useServerData | boolean | Whether to use data from the server performing the evaluation. |
| data | Bundle | Data to be made available during CQL evaluation. |
| dataEndpoint | Endpoint | An endpoint to use to access data referenced by retrieve operations in libraries referenced by the Questionnaire. |
| contentEndpoint | Endpoint | An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire. |
| terminologyEndpoint | Endpoint | An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing) referenced by the Questionnaire. |
## Extract
The `QuestionnaireResponse/$extract` [operation](http://hl7.org/fhir/uv/sdc/OperationDefinition-QuestionnaireResponse-extract.html) takes a completed [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) and converts it to a Bundle of resources by using metadata embedded in the [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) the QuestionnaireResponse is based on. The extracted resources might include Observations, MedicationStatements and other standard FHIR resources which can then be shared and manipulated. When invoking the $extract operation, care should be taken that the submitted QuestionnaireResponse is itself valid. If not, the extract operation could fail (with appropriate OperationOutcomes) or, more problematic, might succeed but provide incorrect output.
This implementation allows for both [Observation based](https://hl7.org/fhir/uv/sdc/extraction.html#observation-based-extraction) and [Definition based](https://hl7.org/fhir/uv/sdc/extraction.html#definition-based-extraction) extraction.
### Parameters
The following parameters are supported for the `QuestionnaireResponse/$extract` operation:
| Parameter | Type | Description |
|-----------|------|-------------|
| questionnaire-response | QuestionnaireResponse | The QuestionnaireResponse to extract data from. Used when the operation is invoked at the 'type' level. |
| parameters | Parameters | Any input parameters defined in libraries referenced by the Questionnaire. |
| data | Bundle | Data to be made available during CQL evaluation. |
## Package
The `Questionnaire/$package` [operation](https://build.fhir.org/ig/HL7/crmi-ig/OperationDefinition-crmi-package.html) for [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) will generate a Bundle of resources that includes the Questionnaire as well as any related Library or ValueSet resources which can then be shared. This implementation follows the [CRMI IG](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/index.html) guidance for [packaging artifacts](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html).
### Parameters
The following parameters are supported for the `Questionnaire/$package` operation:
| Parameter | Type | Description |
|-----------|-----------|-------------|
| id | string | The logical id of an existing Resource to package on the server. |
| canonical | canonical | A canonical url (optionally version specific) of a Resource to package on the server. |
| url | uri | A canonical or artifact reference to a Resource to package on the server. This is exclusive with the canonical parameter. |
| version | string | The version of the Resource. This is exclusive with the canonical parameter. |
| usePut | boolean | Determines the type of method returned in the Bundle Entries: POST if False (the default), PUT if True. |
## Example Questionnaire
```json
{
@ -219,7 +298,7 @@ The `populate` operation generates a [QuestionnaireResponse](https://www.hl7.org
}
```
### Example QuestionnaireResponse
## Example QuestionnaireResponse
```json
{
@ -486,14 +565,3 @@ The `populate` operation generates a [QuestionnaireResponse](https://www.hl7.org
]
}
```
## Extract
The `extract` operation takes a completed [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) and converts it to a Bundle of resources by using metadata embedded in the [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) the QuestionnaireResponse is based on. The extracted resources might include Observations, MedicationStatements and other standard FHIR resources which can then be shared and manipulated. When invoking the $extract operation, care should be taken that the submitted QuestionnaireResponse is itself valid. If not, the extract operation could fail (with appropriate OperationOutcomes) or, more problematic, might succeed but provide incorrect output.
This implementation allows for both [Observation based](https://hl7.org/fhir/uv/sdc/extraction.html#observation-based-extraction) and [Definition based](https://hl7.org/fhir/uv/sdc/extraction.html#definition-based-extraction) extraction.
## Package
The `package` operation for [Questionnaire](https://www.hl7.org/fhir/questionnaire.html) will generate a Bundle of resources that includes the Questionnaire as well as any related Library or ValueSet resources which can then be shared. This implementation follows the [CRMI IG](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/index.html) guidance for [packaging artifacts](https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html).

View File

@ -11,7 +11,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -117,12 +117,12 @@ public class ProviderConstants {
public static final String CR_OPERATION_EVALUATE = "$evaluate";
public static final String CR_OPERATION_CQL = "$cql";
public static final String CR_OPERATION_APPLY = "$apply";
public static final String CR_OPERATION_R5_APPLY = "$r5.apply";
public static final String CR_OPERATION_PREPOPULATE = "$prepopulate";
public static final String CR_OPERATION_POPULATE = "$populate";
public static final String CR_OPERATION_EXTRACT = "$extract";
public static final String CR_OPERATION_PACKAGE = "$package";
public static final String CR_OPERATION_QUESTIONNAIRE = "$questionnaire";
/**
* Operation name for the $meta operation

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>hapi-fhir-serviceloaders</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>hapi-fhir-serviceloaders</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -21,7 +21,7 @@
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-caching-api</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>hapi-fhir-serviceloaders</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<artifactId>hapi-fhir</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>hapi-deployable-pom</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
</parent>
<artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -0,0 +1,50 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.common;
import ca.uhn.fhir.context.FhirVersionEnum;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
public class CanonicalHelper {
public static <C extends IPrimitiveType<String>> C getCanonicalType(
FhirVersionEnum fhirVersion, String theCanonical, String theUrl, String theVersion) {
String url = theVersion == null ? theUrl : String.format("%s|%s", theUrl, theVersion);
String canonical = theCanonical == null ? url : theCanonical;
return newCanonicalType(fhirVersion, canonical);
}
@SuppressWarnings("unchecked")
private static <C extends IPrimitiveType<String>> C newCanonicalType(
FhirVersionEnum fhirVersion, String theCanonical) {
if (theCanonical == null) {
return null;
}
switch (fhirVersion) {
case DSTU3:
return (C) new org.hl7.fhir.dstu3.model.StringType(theCanonical);
case R4:
return (C) new org.hl7.fhir.r4.model.CanonicalType(theCanonical);
case R5:
return (C) new org.hl7.fhir.r5.model.CanonicalType(theCanonical);
default:
return null;
}
}
}

View File

@ -17,10 +17,10 @@
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.r4;
package ca.uhn.fhir.cr.common;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.activitydefinition.r4.ActivityDefinitionProcessor;
import org.opencds.cqf.fhir.cr.activitydefinition.ActivityDefinitionProcessor;
@FunctionalInterface
public interface IActivityDefinitionProcessorFactory {

View File

@ -17,10 +17,10 @@
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.r4;
package ca.uhn.fhir.cr.common;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.plandefinition.r4.PlanDefinitionProcessor;
import org.opencds.cqf.fhir.cr.plandefinition.PlanDefinitionProcessor;
@FunctionalInterface
public interface IPlanDefinitionProcessorFactory {

View File

@ -17,10 +17,10 @@
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.r4;
package ca.uhn.fhir.cr.common;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.questionnaire.r4.processor.QuestionnaireProcessor;
import org.opencds.cqf.fhir.cr.questionnaire.QuestionnaireProcessor;
@FunctionalInterface
public interface IQuestionnaireProcessorFactory {

View File

@ -17,10 +17,10 @@
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.r4;
package ca.uhn.fhir.cr.common;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.questionnaireresponse.r4.QuestionnaireResponseProcessor;
import org.opencds.cqf.fhir.cr.questionnaireresponse.QuestionnaireResponseProcessor;
@FunctionalInterface
public interface IQuestionnaireResponseProcessorFactory {

View File

@ -17,7 +17,7 @@
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.config.r4;
package ca.uhn.fhir.cr.config;
import ca.uhn.fhir.cr.common.IRepositoryFactory;
import org.opencds.cqf.fhir.cql.EvaluationSettings;
@ -27,30 +27,30 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class CrProcessorConfig {
@Bean
ca.uhn.fhir.cr.r4.IActivityDefinitionProcessorFactory r4ActivityDefinitionProcessorFactory(
ca.uhn.fhir.cr.common.IActivityDefinitionProcessorFactory activityDefinitionProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.activitydefinition.r4.ActivityDefinitionProcessor(
return rd -> new org.opencds.cqf.fhir.cr.activitydefinition.ActivityDefinitionProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
@Bean
ca.uhn.fhir.cr.r4.IPlanDefinitionProcessorFactory r4PlanDefinitionProcessorFactory(
ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory planDefinitionProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.plandefinition.r4.PlanDefinitionProcessor(
return rd -> new org.opencds.cqf.fhir.cr.plandefinition.PlanDefinitionProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
@Bean
ca.uhn.fhir.cr.r4.IQuestionnaireProcessorFactory r4QuestionnaireProcessorFactory(
ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory questionnaireProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.questionnaire.r4.processor.QuestionnaireProcessor(
return rd -> new org.opencds.cqf.fhir.cr.questionnaire.QuestionnaireProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
@Bean
ca.uhn.fhir.cr.r4.IQuestionnaireResponseProcessorFactory r4QuestionnaireResponseProcessorFactory(
ca.uhn.fhir.cr.common.IQuestionnaireResponseProcessorFactory questionnaireResponseProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.questionnaireresponse.r4.QuestionnaireResponseProcessor(
return rd -> new org.opencds.cqf.fhir.cr.questionnaireresponse.QuestionnaireResponseProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
}

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.dstu3;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -1,56 +0,0 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.config.dstu3;
import ca.uhn.fhir.cr.common.IRepositoryFactory;
import org.opencds.cqf.fhir.cql.EvaluationSettings;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CrProcessorConfig {
@Bean
ca.uhn.fhir.cr.dstu3.IActivityDefinitionProcessorFactory dstu3ActivityDefinitionProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.activitydefinition.dstu3.ActivityDefinitionProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
@Bean
ca.uhn.fhir.cr.dstu3.IPlanDefinitionProcessorFactory dstu3PlanDefinitionProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.plandefinition.dstu3.PlanDefinitionProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
@Bean
ca.uhn.fhir.cr.dstu3.IQuestionnaireProcessorFactory dstu3QuestionnaireProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.questionnaire.dstu3.processor.QuestionnaireProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
@Bean
ca.uhn.fhir.cr.dstu3.IQuestionnaireResponseProcessorFactory dstu3QuestionnaireResponseProcessorFactory(
IRepositoryFactory theRepositoryFactory, EvaluationSettings theEvaluationSettings) {
return rd -> new org.opencds.cqf.fhir.cr.questionnaireresponse.dstu3.QuestionnaireResponseProcessor(
theRepositoryFactory.create(rd), theEvaluationSettings);
}
}

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.dstu3;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.dstu3;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.dstu3;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -0,0 +1,53 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.config.dstu3;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import java.util.Arrays;
import java.util.Map;
public class QuestionnaireOperationConfig {
@Bean
ca.uhn.fhir.cr.dstu3.structuredefinition.StructureDefinitionQuestionnaireProvider
dstu3StructureDefinitionQuestionnaireProvider() {
return new ca.uhn.fhir.cr.dstu3.structuredefinition.StructureDefinitionQuestionnaireProvider();
}
@Bean(name = "questionnaireOperationLoader")
public ProviderLoader questionnaireOperationLoader(
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
var selector = new ProviderSelector(
theFhirContext,
Map.of(
FhirVersionEnum.DSTU3,
Arrays.asList(
ca.uhn.fhir.cr.dstu3.structuredefinition.StructureDefinitionQuestionnaireProvider
.class)));
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
}
}

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.r4;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -101,7 +101,6 @@ public class CrR4Config {
theCareGapsProperties,
theRepositoryFactory.create(rd),
theMeasureEvaluationOptions,
theExecutor,
rd.getFhirServerBase());
}

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.r4;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.r4;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.cr.config.r4;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.CrProcessorConfig;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;

View File

@ -0,0 +1,52 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.config.r4;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.config.ProviderLoader;
import ca.uhn.fhir.cr.config.ProviderSelector;
import ca.uhn.fhir.rest.server.RestfulServer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import java.util.Arrays;
import java.util.Map;
public class QuestionnaireOperationConfig {
@Bean
ca.uhn.fhir.cr.r4.structuredefinition.StructureDefinitionQuestionnaireProvider
r4StructureDefinitionQuestionnaireProvider() {
return new ca.uhn.fhir.cr.r4.structuredefinition.StructureDefinitionQuestionnaireProvider();
}
@Bean(name = "questionnaireOperationLoader")
public ProviderLoader questionnaireOperationLoader(
ApplicationContext theApplicationContext, FhirContext theFhirContext, RestfulServer theRestfulServer) {
var selector = new ProviderSelector(
theFhirContext,
Map.of(
FhirVersionEnum.R4,
Arrays.asList(
ca.uhn.fhir.cr.r4.structuredefinition.StructureDefinitionQuestionnaireProvider.class)));
return new ProviderLoader(theRestfulServer, theApplicationContext, selector);
}
}

View File

@ -1,28 +0,0 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.dstu3;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.activitydefinition.dstu3.ActivityDefinitionProcessor;
@FunctionalInterface
public interface IActivityDefinitionProcessorFactory {
ActivityDefinitionProcessor create(RequestDetails theRequestDetails);
}

View File

@ -1,28 +0,0 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.dstu3;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.plandefinition.dstu3.PlanDefinitionProcessor;
@FunctionalInterface
public interface IPlanDefinitionProcessorFactory {
PlanDefinitionProcessor create(RequestDetails theRequestDetails);
}

View File

@ -1,28 +0,0 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.dstu3;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.questionnaire.dstu3.processor.QuestionnaireProcessor;
@FunctionalInterface
public interface IQuestionnaireProcessorFactory {
QuestionnaireProcessor create(RequestDetails theRequestDetails);
}

View File

@ -1,28 +0,0 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.dstu3;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.opencds.cqf.fhir.cr.questionnaireresponse.dstu3.QuestionnaireResponseProcessor;
@FunctionalInterface
public interface IQuestionnaireResponseProcessorFactory {
QuestionnaireResponseProcessor create(RequestDetails theRequestDetails);
}

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.cr.dstu3.activitydefinition;
* #L%
*/
import ca.uhn.fhir.cr.dstu3.IActivityDefinitionProcessorFactory;
import ca.uhn.fhir.cr.common.IActivityDefinitionProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -37,13 +37,14 @@ import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ActivityDefinitionApplyProvider {
@Autowired
IActivityDefinitionProcessorFactory myDstu3ActivityDefinitionProcessorFactory;
IActivityDefinitionProcessorFactory myActivityDefinitionProcessorFactory;
/**
* Implements the <a href=
@ -101,12 +102,13 @@ public class ActivityDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3ActivityDefinitionProcessorFactory
return myActivityDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
theId,
new StringType(theCanonical),
theActivityDefinition,
Eithers.for3(
theCanonical == null ? null : new StringType(theCanonical),
theId,
theActivityDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -117,7 +119,7 @@ public class ActivityDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
theDataEndpoint,
theContentEndpoint,
@ -145,12 +147,13 @@ public class ActivityDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3ActivityDefinitionProcessorFactory
return myActivityDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
null,
new StringType(theCanonical),
theActivityDefinition,
Eithers.for3(
theCanonical == null ? null : new StringType(theCanonical),
null,
theActivityDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -161,7 +164,7 @@ public class ActivityDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
theDataEndpoint,
theContentEndpoint,

View File

@ -20,7 +20,8 @@ package ca.uhn.fhir.cr.dstu3.plandefinition;
* #L%
*/
import ca.uhn.fhir.cr.dstu3.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -37,13 +38,16 @@ import org.hl7.fhir.dstu3.model.PlanDefinition;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
@Component
public class PlanDefinitionApplyProvider {
@Autowired
IPlanDefinitionProcessorFactory myDstu3PlanDefinitionProcessorFactory;
IPlanDefinitionProcessorFactory myPlanDefinitionProcessorFactory;
/**
* Implements the <a href=
@ -53,8 +57,10 @@ public class PlanDefinitionApplyProvider {
* Reasoning Module</a>.
*
* @param theId The id of the PlanDefinition to apply
* @param theCanonical The canonical identifier for the PlanDefinition to apply (optionally version-specific)
* @param thePlanDefinition The PlanDefinition to be applied
* @param theCanonical The canonical url of the plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the planDefinition parameter must be supplied.
* @param theUrl Canonical URL of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters.
* @param theVersion Version of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the plan definition to be applied.
* @param theEncounter The encounter in context
* @param thePractitioner The practitioner in context
@ -82,8 +88,10 @@ public class PlanDefinitionApplyProvider {
@Operation(name = ProviderConstants.CR_OPERATION_APPLY, idempotent = true, type = PlanDefinition.class)
public IBaseResource apply(
@IdParam IdType theId,
@OperationParam(name = "planDefinition") org.hl7.fhir.r4.model.PlanDefinition thePlanDefinition,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "planDefinition") PlanDefinition thePlanDefinition,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "encounter") String theEncounter,
@OperationParam(name = "practitioner") String thePractitioner,
@ -101,12 +109,11 @@ public class PlanDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3PlanDefinitionProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
theId,
new StringType(theCanonical),
thePlanDefinition,
Eithers.for3(canonicalType, theId, thePlanDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -117,7 +124,7 @@ public class PlanDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
null,
theDataEndpoint,
@ -127,8 +134,10 @@ public class PlanDefinitionApplyProvider {
@Operation(name = ProviderConstants.CR_OPERATION_APPLY, idempotent = true, type = PlanDefinition.class)
public IBaseResource apply(
@OperationParam(name = "planDefinition") org.hl7.fhir.r4.model.PlanDefinition thePlanDefinition,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "planDefinition") PlanDefinition thePlanDefinition,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "encounter") String theEncounter,
@OperationParam(name = "practitioner") String thePractitioner,
@ -146,12 +155,11 @@ public class PlanDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3PlanDefinitionProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
null,
new StringType(theCanonical),
thePlanDefinition,
Eithers.for3(canonicalType, null, thePlanDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -162,7 +170,7 @@ public class PlanDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
null,
theDataEndpoint,

View File

@ -19,49 +19,61 @@
*/
package ca.uhn.fhir.cr.dstu3.plandefinition;
import ca.uhn.fhir.cr.dstu3.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.PlanDefinition;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class PlanDefinitionPackageProvider {
@Autowired
IPlanDefinitionProcessorFactory mydstu3PlanDefinitionProcessorFactory;
IPlanDefinitionProcessorFactory myPlanDefinitionProcessorFactory;
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = PlanDefinition.class)
public IBaseBundle packagePlanDefinition(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "usePut") String theIsPut,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") BooleanType theIsPut,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return mydstu3PlanDefinitionProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.packagePlanDefinition(theId, new StringType(theCanonical), null, Boolean.parseBoolean(theIsPut));
.packagePlanDefinition(
Eithers.for3(canonicalType, theId, null),
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
}
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = PlanDefinition.class)
public IBaseBundle packagePlanDefinition(
@OperationParam(name = "id") String theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "usePut") String theIsPut,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") BooleanType theIsPut,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return mydstu3PlanDefinitionProcessorFactory
IdType id = theId == null ? null : new IdType("PlanDefinition", theId);
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.packagePlanDefinition(
new IdType("PlanDefinition", theId),
new StringType(theCanonical),
null,
Boolean.parseBoolean(theIsPut));
Eithers.for3(canonicalType, id, null),
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
}
}

View File

@ -19,7 +19,8 @@
*/
package ca.uhn.fhir.cr.dstu3.questionnaire;
import ca.uhn.fhir.cr.dstu3.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -29,11 +30,14 @@ import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Questionnaire;
import org.hl7.fhir.dstu3.model.StringType;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class QuestionnairePackageProvider {
@Autowired
IQuestionnaireProcessorFactory myDstu3QuestionnaireProcessorFactory;
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
/**
* Implements a $package operation following the <a href=
@ -41,6 +45,8 @@ public class QuestionnairePackageProvider {
*
* @param theId The id of the Questionnaire.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @Param theIsPut A boolean value to determine if the Bundle returned uses PUT or POST request methods. Defaults to false.
* @param theRequestDetails The details (such as tenant) of this request. Usually
* autopopulated by HAPI.
@ -50,20 +56,26 @@ public class QuestionnairePackageProvider {
public Bundle packageQuestionnaire(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") String theIsPut,
RequestDetails theRequestDetails) {
return (Bundle) myDstu3QuestionnaireProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return (Bundle) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.packageQuestionnaire(theId, new StringType(theCanonical), null, Boolean.parseBoolean(theIsPut));
.packageQuestionnaire(Eithers.for3(canonicalType, theId, null), Boolean.parseBoolean(theIsPut));
}
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Questionnaire.class)
public Bundle packageQuestionnaire(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") String theIsPut,
RequestDetails theRequestDetails) {
return (Bundle) myDstu3QuestionnaireProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return (Bundle) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.packageQuestionnaire(null, new StringType(theCanonical), null, Boolean.parseBoolean(theIsPut));
.packageQuestionnaire(Eithers.for3(canonicalType, null, null), Boolean.parseBoolean(theIsPut));
}
}

View File

@ -20,13 +20,15 @@ package ca.uhn.fhir.cr.dstu3.questionnaire;
* #L%
*/
import ca.uhn.fhir.cr.dstu3.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.Endpoint;
import org.hl7.fhir.dstu3.model.IdType;
@ -35,11 +37,14 @@ import org.hl7.fhir.dstu3.model.Questionnaire;
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.exceptions.FHIRException;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class QuestionnairePopulateProvider {
@Autowired
IQuestionnaireProcessorFactory myDstu3QuestionnaireProcessorFactory;
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
/**
* Implements a modified version of the <a href=
@ -50,11 +55,14 @@ public class QuestionnairePopulateProvider {
* than a QuestionnaireResponse with the answers filled out.
*
* @param theId The id of the Questionnaire to populate.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theQuestionnaire The Questionnaire to populate. Used when the operation is invoked at the 'type' level.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
* @param theBundle Data to be made available during CQL evaluation.
* @param theData Data to be made available during CQL evaluation.
* @param theUseServerData Whether to use data from the server performing the evaluation.
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
* referenced by the Questionnaire.
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire.
@ -67,25 +75,28 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_PREPOPULATE, idempotent = true, type = Questionnaire.class)
public Questionnaire prepopulate(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3QuestionnaireProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return myQuestionnaireProcessorFactory
.create(theRequestDetails)
.prePopulate(
theId,
new StringType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, theId, theQuestionnaire),
theSubject,
theParameters,
theBundle,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);
@ -93,25 +104,28 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_PREPOPULATE, idempotent = true, type = Questionnaire.class)
public Questionnaire prepopulate(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3QuestionnaireProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return myQuestionnaireProcessorFactory
.create(theRequestDetails)
.prePopulate(
null,
new StringType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, null, theQuestionnaire),
theSubject,
theParameters,
theBundle,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);
@ -124,11 +138,14 @@ public class QuestionnairePopulateProvider {
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
*
* @param theId The id of the Questionnaire to populate.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theQuestionnaire The Questionnaire to populate. Used when the operation is invoked at the 'type' level.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
* @param theBundle Data to be made available during CQL evaluation.
* @param theData Data to be made available during CQL evaluation.
* @param theUseServerData Whether to use data from the server performing the evaluation.
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
* referenced by the Questionnaire.
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire.
@ -141,25 +158,28 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_POPULATE, idempotent = true, type = Questionnaire.class)
public QuestionnaireResponse populate(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return (QuestionnaireResponse) myDstu3QuestionnaireProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return (QuestionnaireResponse) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.populate(
theId,
new StringType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, theId, theQuestionnaire),
theSubject,
theParameters,
theBundle,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);
@ -167,25 +187,28 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_POPULATE, idempotent = true, type = Questionnaire.class)
public QuestionnaireResponse populate(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return (QuestionnaireResponse) myDstu3QuestionnaireProcessorFactory
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return (QuestionnaireResponse) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.populate(
null,
new StringType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, null, theQuestionnaire),
theSubject,
theParameters,
theBundle,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);

View File

@ -20,31 +20,35 @@ package ca.uhn.fhir.cr.dstu3.questionnaireresponse;
* #L%
*/
import ca.uhn.fhir.cr.dstu3.IQuestionnaireResponseProcessorFactory;
import ca.uhn.fhir.cr.common.IQuestionnaireResponseProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.QuestionnaireResponse;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
public class QuestionnaireResponseExtractProvider {
@Autowired
IQuestionnaireResponseProcessorFactory myDstu3QuestionnaireResponseProcessorFactory;
IQuestionnaireResponseProcessorFactory myQuestionnaireResponseProcessorFactory;
/**
* Implements the <a href=
* "http://build.fhir.org/ig/HL7/sdc/OperationDefinition-QuestionnaireResponse-extract.html>$extract</a>
* Implements the <a href="http://build.fhir.org/ig/HL7/sdc/OperationDefinition-QuestionnaireResponse-extract.html>$extract</a>
* operation found in the
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
*
* @param theId The id of the QuestionnaireResponse to extract data from.
* @param theQuestionnaireResponse The QuestionnaireResponse to extract data from. Used when the operation is invoked at the 'type' level.
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
* @param theData Data to be made available during CQL evaluation.
* @param theRequestDetails The details (such as tenant) of this request. Usually
* autopopulated HAPI.
* @return The resulting FHIR resource produced after extracting data. This will either be a single resource or a Transaction Bundle that contains multiple resources.
@ -53,20 +57,24 @@ public class QuestionnaireResponseExtractProvider {
public IBaseBundle extract(
@IdParam IdType theId,
@OperationParam(name = "questionnaire-response") QuestionnaireResponse theQuestionnaireResponse,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "data") Bundle theData,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3QuestionnaireResponseProcessorFactory
return myQuestionnaireResponseProcessorFactory
.create(theRequestDetails)
.extract(theId, theQuestionnaireResponse, null, null, null);
.extract(Eithers.for2(theId, theQuestionnaireResponse), theParameters, theData);
}
@Operation(name = ProviderConstants.CR_OPERATION_EXTRACT, idempotent = true, type = QuestionnaireResponse.class)
public IBaseBundle extract(
@OperationParam(name = "questionnaire-response") QuestionnaireResponse theQuestionnaireResponse,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "data") Bundle theData,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myDstu3QuestionnaireResponseProcessorFactory
return myQuestionnaireResponseProcessorFactory
.create(theRequestDetails)
.extract(null, theQuestionnaireResponse, null, null, null);
.extract(Eithers.for2(null, theQuestionnaireResponse), theParameters, theData);
}
}

View File

@ -0,0 +1,138 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.dstu3.structuredefinition;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.Endpoint;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.Questionnaire;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.dstu3.model.StructureDefinition;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class StructureDefinitionQuestionnaireProvider {
@Autowired
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
/**
* Implements the <a href=
* "http://build.fhir.org/ig/HL7/sdc/OperationDefinition-Questionnaire-populate.html">$populate</a>
* operation found in the
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
*
* @param theId The id of the StructureDefinition.
* @param theProfile The StructureDefinition to base the Questionnaire on. Used when the operation is invoked at the 'type' level.
* @param theCanonical The canonical identifier for the StructureDefinition (optionally version-specific).
* @param theUrl Canonical URL of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters.
* @param theVersion Version of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters.
* @param theSupportedOnly If true (default: false), the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition.
* @param theRequiredOnly If true (default: false), the questionnaire will only include those elements marked as "min>0" in the StructureDefinition.
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
* @param theParameters Any input parameters defined in libraries referenced by the StructureDefinition.
* @param theUseServerData Whether to use data from the server performing the evaluation.
* @param theData Data to be made available during CQL evaluation.
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
* referenced by the StructureDefinition.
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the StructureDefinition.
* @param theTerminologyEndpoint An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing)
* referenced by the StructureDefinition.
* @param theRequestDetails The details (such as tenant) of this request. Usually
* autopopulated HAPI.
* @return The questionnaire form generated based on the StructureDefinition.
*/
@Operation(name = ProviderConstants.CR_OPERATION_QUESTIONNAIRE, idempotent = true, type = StructureDefinition.class)
public Questionnaire questionnaire(
@IdParam IdType theId,
@OperationParam(name = "profile") StructureDefinition theProfile,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "supportedOnly") BooleanType theSupportedOnly,
@OperationParam(name = "requiredOnly") BooleanType theRequiredOnly,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails) {
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return (Questionnaire) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.generateQuestionnaire(
Eithers.for3(canonicalType, theId, theProfile),
theSupportedOnly == null ? Boolean.TRUE : theSupportedOnly.booleanValue(),
theRequiredOnly == null ? Boolean.TRUE : theRequiredOnly.booleanValue(),
theSubject,
theParameters,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint,
null);
}
@Operation(name = ProviderConstants.CR_OPERATION_QUESTIONNAIRE, idempotent = true, type = StructureDefinition.class)
public Questionnaire questionnaire(
@OperationParam(name = "profile") StructureDefinition theProfile,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "supportedOnly") BooleanType theSupportedOnly,
@OperationParam(name = "requiredOnly") BooleanType theRequiredOnly,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails) {
StringType canonicalType = getCanonicalType(FhirVersionEnum.DSTU3, theCanonical, theUrl, theVersion);
return (Questionnaire) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.generateQuestionnaire(
Eithers.for3(canonicalType, null, theProfile),
theSupportedOnly == null ? Boolean.TRUE : theSupportedOnly.booleanValue(),
theRequiredOnly == null ? Boolean.TRUE : theRequiredOnly.booleanValue(),
theSubject,
theParameters,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint,
null);
}
}

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.cr.r4.activitydefinition;
* #L%
*/
import ca.uhn.fhir.cr.r4.IActivityDefinitionProcessorFactory;
import ca.uhn.fhir.cr.common.IActivityDefinitionProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -29,14 +29,22 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r4.model.*;
import org.hl7.fhir.r4.model.ActivityDefinition;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Endpoint;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Parameters;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class ActivityDefinitionApplyProvider {
@Autowired
IActivityDefinitionProcessorFactory myR4ActivityDefinitionProcessorFactory;
IActivityDefinitionProcessorFactory myActivityDefinitionProcessorFactory;
/**
* Implements the <a href=
@ -95,12 +103,13 @@ public class ActivityDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4ActivityDefinitionProcessorFactory
return myActivityDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
theId,
new CanonicalType(theCanonical),
theActivityDefinition,
Eithers.for3(
theCanonical == null ? null : new CanonicalType(theCanonical),
theId,
theActivityDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -111,7 +120,7 @@ public class ActivityDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
theDataEndpoint,
theContentEndpoint,
@ -139,12 +148,13 @@ public class ActivityDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4ActivityDefinitionProcessorFactory
return myActivityDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
null,
new CanonicalType(theCanonical),
theActivityDefinition,
Eithers.for3(
theCanonical == null ? null : new CanonicalType(theCanonical),
null,
theActivityDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -155,7 +165,7 @@ public class ActivityDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
theDataEndpoint,
theContentEndpoint,

View File

@ -20,7 +20,8 @@ package ca.uhn.fhir.cr.r4.plandefinition;
* #L%
*/
import ca.uhn.fhir.cr.r4.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -29,14 +30,24 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r4.model.*;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Endpoint;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.PlanDefinition;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
@Component
public class PlanDefinitionApplyProvider {
@Autowired
IPlanDefinitionProcessorFactory myR4PlanDefinitionProcessorFactory;
IPlanDefinitionProcessorFactory myPlanDefinitionProcessorFactory;
/**
* Implements the <a href=
@ -48,8 +59,10 @@ public class PlanDefinitionApplyProvider {
* CPG IG</a>.
*
* @param theId The id of the PlanDefinition to apply
* @param theCanonical The canonical identifier for the PlanDefinition to apply (optionally version-specific)
* @param thePlanDefinition The PlanDefinition to be applied
* @param theCanonical The canonical url of the plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the planDefinition parameter must be supplied.
* @param theUrl Canonical URL of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters.
* @param theVersion Version of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the plan definition to be applied.
* @param theEncounter The encounter in context
* @param thePractitioner The practitioner in context
@ -77,8 +90,10 @@ public class PlanDefinitionApplyProvider {
@Operation(name = ProviderConstants.CR_OPERATION_APPLY, idempotent = true, type = PlanDefinition.class)
public IBaseResource apply(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "planDefinition") PlanDefinition thePlanDefinition,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "encounter") String theEncounter,
@OperationParam(name = "practitioner") String thePractitioner,
@ -96,12 +111,11 @@ public class PlanDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4PlanDefinitionProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
theId,
new CanonicalType(theCanonical),
thePlanDefinition,
Eithers.for3(canonicalType, theId, thePlanDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -112,7 +126,7 @@ public class PlanDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
null,
theDataEndpoint,
@ -122,8 +136,10 @@ public class PlanDefinitionApplyProvider {
@Operation(name = ProviderConstants.CR_OPERATION_APPLY, idempotent = true, type = PlanDefinition.class)
public IBaseResource apply(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "planDefinition") PlanDefinition thePlanDefinition,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "encounter") String theEncounter,
@OperationParam(name = "practitioner") String thePractitioner,
@ -141,12 +157,11 @@ public class PlanDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4PlanDefinitionProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.apply(
null,
new CanonicalType(theCanonical),
thePlanDefinition,
Eithers.for3(canonicalType, null, thePlanDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -157,7 +172,7 @@ public class PlanDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
null,
theDataEndpoint,
@ -175,8 +190,10 @@ public class PlanDefinitionApplyProvider {
* CPG IG</a>. This implementation follows the R5 specification and returns a bundle of RequestGroups rather than a CarePlan.
*
* @param theId The id of the PlanDefinition to apply
* @param theCanonical The canonical identifier for the PlanDefinition to apply (optionally version-specific)
* @param thePlanDefinition The PlanDefinition to be applied
* @param theCanonical The canonical url of the plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter (and optionally the version), or the planDefinition parameter must be supplied.
* @param theUrl Canonical URL of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters.
* @param theVersion Version of the PlanDefinition when invoked at the resource type level. This is exclusive with the planDefinition and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the plan definition to be applied.
* @param theEncounter The encounter in context
* @param thePractitioner The practitioner in context
@ -204,8 +221,10 @@ public class PlanDefinitionApplyProvider {
@Operation(name = ProviderConstants.CR_OPERATION_R5_APPLY, idempotent = true, type = PlanDefinition.class)
public IBaseResource applyR5(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "planDefinition") PlanDefinition thePlanDefinition,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "encounter") String theEncounter,
@OperationParam(name = "practitioner") String thePractitioner,
@ -223,12 +242,11 @@ public class PlanDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4PlanDefinitionProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.applyR5(
theId,
new CanonicalType(theCanonical),
thePlanDefinition,
Eithers.for3(canonicalType, theId, thePlanDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -239,7 +257,7 @@ public class PlanDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
null,
theDataEndpoint,
@ -249,8 +267,10 @@ public class PlanDefinitionApplyProvider {
@Operation(name = ProviderConstants.CR_OPERATION_R5_APPLY, idempotent = true, type = PlanDefinition.class)
public IBaseResource applyR5(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "planDefinition") PlanDefinition thePlanDefinition,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "encounter") String theEncounter,
@OperationParam(name = "practitioner") String thePractitioner,
@ -268,12 +288,11 @@ public class PlanDefinitionApplyProvider {
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4PlanDefinitionProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.applyR5(
null,
new CanonicalType(theCanonical),
thePlanDefinition,
Eithers.for3(canonicalType, null, thePlanDefinition),
theSubject,
theEncounter,
thePractitioner,
@ -284,7 +303,7 @@ public class PlanDefinitionApplyProvider {
theSetting,
theSettingContext,
theParameters,
theUseServerData == null ? true : theUseServerData.booleanValue(),
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theData,
null,
theDataEndpoint,

View File

@ -19,7 +19,8 @@
*/
package ca.uhn.fhir.cr.r4.plandefinition;
import ca.uhn.fhir.cr.r4.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IPlanDefinitionProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -28,40 +29,51 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.PlanDefinition;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class PlanDefinitionPackageProvider {
@Autowired
IPlanDefinitionProcessorFactory myR4PlanDefinitionProcessorFactory;
IPlanDefinitionProcessorFactory myPlanDefinitionProcessorFactory;
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = PlanDefinition.class)
public IBaseBundle packagePlanDefinition(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "usePut") String theIsPut,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") BooleanType theIsPut,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4PlanDefinitionProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.packagePlanDefinition(theId, new CanonicalType(theCanonical), null, Boolean.parseBoolean(theIsPut));
.packagePlanDefinition(
Eithers.for3(canonicalType, theId, null),
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
}
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = PlanDefinition.class)
public IBaseBundle packagePlanDefinition(
@OperationParam(name = "id") String theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "usePut") String theIsPut,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") BooleanType theIsPut,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4PlanDefinitionProcessorFactory
IdType id = theId == null ? null : new IdType("PlanDefinition", theId);
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return myPlanDefinitionProcessorFactory
.create(theRequestDetails)
.packagePlanDefinition(
new IdType("PlanDefinition", theId),
new CanonicalType(theCanonical),
null,
Boolean.parseBoolean(theIsPut));
Eithers.for3(canonicalType, id, null),
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
}
}

View File

@ -19,29 +19,36 @@
*/
package ca.uhn.fhir.cr.r4.questionnaire;
import ca.uhn.fhir.cr.r4.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Questionnaire;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class QuestionnairePackageProvider {
@Autowired
IQuestionnaireProcessorFactory myR4QuestionnaireProcessorFactory;
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
/**
* Implements a $package operation following the <a href=
* "https://build.fhir.org/ig/HL7/crmi-ig/branches/master/packaging.html">CRMI IG</a>.
*
* @param theId The id of the Questionnaire.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @Param theIsPut A boolean value to determine if the Bundle returned uses PUT or POST request methods. Defaults to false.
* @param theCanonical The canonical identifier for the Questionnaire (optionally version-specific).
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @Param theIsPut A boolean value to determine if the Bundle returned uses PUT or POST request methods. Defaults to false.
* @param theRequestDetails The details (such as tenant) of this request. Usually
* autopopulated by HAPI.
* @return A Bundle containing the Questionnaire and all related Library, CodeSystem and ValueSet resources
@ -50,20 +57,30 @@ public class QuestionnairePackageProvider {
public Bundle packageQuestionnaire(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "usePut") String theIsPut,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") BooleanType theIsPut,
RequestDetails theRequestDetails) {
return (Bundle) myR4QuestionnaireProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return (Bundle) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.packageQuestionnaire(theId, new CanonicalType(theCanonical), null, Boolean.parseBoolean(theIsPut));
.packageQuestionnaire(
Eithers.for3(canonicalType, theId, null),
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
}
@Operation(name = ProviderConstants.CR_OPERATION_PACKAGE, idempotent = true, type = Questionnaire.class)
public Bundle packageQuestionnaire(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "usePut") String theIsPut,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "usePut") BooleanType theIsPut,
RequestDetails theRequestDetails) {
return (Bundle) myR4QuestionnaireProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return (Bundle) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.packageQuestionnaire(null, new CanonicalType(theCanonical), null, Boolean.parseBoolean(theIsPut));
.packageQuestionnaire(
Eithers.for3(canonicalType, null, null),
theIsPut == null ? Boolean.FALSE : theIsPut.booleanValue());
}
}

View File

@ -20,7 +20,8 @@ package ca.uhn.fhir.cr.r4.questionnaire;
* #L%
*/
import ca.uhn.fhir.cr.r4.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -28,6 +29,7 @@ import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.Endpoint;
@ -35,11 +37,14 @@ import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.Questionnaire;
import org.hl7.fhir.r4.model.QuestionnaireResponse;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class QuestionnairePopulateProvider {
@Autowired
IQuestionnaireProcessorFactory myR4QuestionnaireProcessorFactory;
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
/**
* Implements a modified version of the <a href=
@ -50,11 +55,15 @@ public class QuestionnairePopulateProvider {
* than a QuestionnaireResponse with the answers filled out.
*
* @param theId The id of the Questionnaire to populate.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theQuestionnaire The Questionnaire to populate. Used when the operation is invoked at the 'type' level.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
* @param theBundle Data to be made available during CQL evaluation.
* @param theUseServerData Whether to use data from the server performing the evaluation.
* @param theData Data to be made available during CQL evaluation.
* @param theBundle Legacy support for data parameter.
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
* referenced by the Questionnaire.
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire.
@ -67,25 +76,30 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_PREPOPULATE, idempotent = true, type = Questionnaire.class)
public Questionnaire prepopulate(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4QuestionnaireProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
Bundle data = theData == null ? theBundle : theData;
return myQuestionnaireProcessorFactory
.create(theRequestDetails)
.prePopulate(
theId,
new CanonicalType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, theId, theQuestionnaire),
theSubject,
theParameters,
theBundle,
data,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);
@ -93,25 +107,30 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_PREPOPULATE, idempotent = true, type = Questionnaire.class)
public Questionnaire prepopulate(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4QuestionnaireProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
Bundle data = theData == null ? theBundle : theData;
return myQuestionnaireProcessorFactory
.create(theRequestDetails)
.prePopulate(
null,
new CanonicalType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, null, theQuestionnaire),
theSubject,
theParameters,
theBundle,
data,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);
@ -124,11 +143,14 @@ public class QuestionnairePopulateProvider {
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
*
* @param theId The id of the Questionnaire to populate.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theQuestionnaire The Questionnaire to populate. Used when the operation is invoked at the 'type' level.
* @param theCanonical The canonical identifier for the questionnaire (optionally version-specific).
* @param theUrl Canonical URL of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theVersion Version of the Questionnaire when invoked at the resource type level. This is exclusive with the questionnaire and canonical parameters.
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
* @param theBundle Data to be made available during CQL evaluation.
* @param theUseServerData Whether to use data from the server performing the evaluation.
* @param theData Data to be made available during CQL evaluation.
* @param theBundle Legacy support for data parameter.
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
* referenced by the Questionnaire.
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the Questionnaire.
@ -141,25 +163,30 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_POPULATE, idempotent = true, type = Questionnaire.class)
public QuestionnaireResponse populate(
@IdParam IdType theId,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return (QuestionnaireResponse) myR4QuestionnaireProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
Bundle data = theData == null ? theBundle : theData;
return (QuestionnaireResponse) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.populate(
theId,
new CanonicalType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, theId, theQuestionnaire),
theSubject,
theParameters,
theBundle,
data,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);
@ -167,25 +194,30 @@ public class QuestionnairePopulateProvider {
@Operation(name = ProviderConstants.CR_OPERATION_POPULATE, idempotent = true, type = Questionnaire.class)
public QuestionnaireResponse populate(
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "questionnaire") Questionnaire theQuestionnaire,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "bundle") Bundle theBundle,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return (QuestionnaireResponse) myR4QuestionnaireProcessorFactory
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
Bundle data = theData == null ? theBundle : theData;
return (QuestionnaireResponse) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.populate(
null,
new CanonicalType(theCanonical),
theQuestionnaire,
Eithers.for3(canonicalType, null, theQuestionnaire),
theSubject,
theParameters,
theBundle,
data,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint);

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.cr.r4.questionnaireresponse;
* #L%
*/
import ca.uhn.fhir.cr.r4.IQuestionnaireResponseProcessorFactory;
import ca.uhn.fhir.cr.common.IQuestionnaireResponseProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
@ -29,22 +29,26 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.QuestionnaireResponse;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
public class QuestionnaireResponseExtractProvider {
@Autowired
IQuestionnaireResponseProcessorFactory myR4QuestionnaireResponseProcessorFactory;
IQuestionnaireResponseProcessorFactory myQuestionnaireResponseProcessorFactory;
/**
* Implements the <a href=
* "http://build.fhir.org/ig/HL7/sdc/OperationDefinition-QuestionnaireResponse-extract.html>$extract</a>
* Implements the <a href="http://build.fhir.org/ig/HL7/sdc/OperationDefinition-QuestionnaireResponse-extract.html>$extract</a>
* operation found in the
* <a href="http://build.fhir.org/ig/HL7/sdc/index.html">Structured Data Capture (SDC) IG</a>.
*
* @param theId The id of the QuestionnaireResponse to extract data from.
* @param theQuestionnaireResponse The QuestionnaireResponse to extract data from. Used when the operation is invoked at the 'type' level.
* @param theParameters Any input parameters defined in libraries referenced by the Questionnaire.
* @param theData Data to be made available during CQL evaluation.
* @param theRequestDetails The details (such as tenant) of this request. Usually
* autopopulated HAPI.
* @return The resulting FHIR resource produced after extracting data. This will either be a single resource or a Transaction Bundle that contains multiple resources.
@ -53,20 +57,24 @@ public class QuestionnaireResponseExtractProvider {
public IBaseBundle extract(
@IdParam IdType theId,
@OperationParam(name = "questionnaire-response") QuestionnaireResponse theQuestionnaireResponse,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "data") Bundle theData,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4QuestionnaireResponseProcessorFactory
return myQuestionnaireResponseProcessorFactory
.create(theRequestDetails)
.extract(theId, theQuestionnaireResponse, null, null, null);
.extract(Eithers.for2(theId, theQuestionnaireResponse), theParameters, theData);
}
@Operation(name = ProviderConstants.CR_OPERATION_EXTRACT, idempotent = true, type = QuestionnaireResponse.class)
public IBaseBundle extract(
@OperationParam(name = "questionnaire-response") QuestionnaireResponse theQuestionnaireResponse,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "data") Bundle theData,
RequestDetails theRequestDetails)
throws InternalErrorException, FHIRException {
return myR4QuestionnaireResponseProcessorFactory
return myQuestionnaireResponseProcessorFactory
.create(theRequestDetails)
.extract(null, theQuestionnaireResponse, null, null, null);
.extract(Eithers.for2(null, theQuestionnaireResponse), theParameters, theData);
}
}

View File

@ -0,0 +1,137 @@
/*-
* #%L
* HAPI FHIR - Clinical Reasoning
* %%
* Copyright (C) 2014 - 2024 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package ca.uhn.fhir.cr.r4.structuredefinition;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.cr.common.IQuestionnaireProcessorFactory;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.provider.ProviderConstants;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.Endpoint;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.Questionnaire;
import org.hl7.fhir.r4.model.StructureDefinition;
import org.opencds.cqf.fhir.utility.monad.Eithers;
import org.springframework.beans.factory.annotation.Autowired;
import static ca.uhn.fhir.cr.common.CanonicalHelper.getCanonicalType;
public class StructureDefinitionQuestionnaireProvider {
@Autowired
IQuestionnaireProcessorFactory myQuestionnaireProcessorFactory;
/**
* Implements the <a href=
* "https://hl7.org/fhir/structuredefinition-operation-questionnaire.html">$questionnaire</a>
* operation.
*
* @param theId The id of the StructureDefinition.
* @param theProfile The StructureDefinition to base the Questionnaire on. Used when the operation is invoked at the 'type' level.
* @param theCanonical The canonical identifier for the StructureDefinition (optionally version-specific).
* @param theUrl Canonical URL of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters.
* @param theVersion Version of the StructureDefinition when invoked at the resource type level. This is exclusive with the profile and canonical parameters.
* @param theSupportedOnly If true (default: false), the questionnaire will only include those elements marked as "mustSupport='true'" in the StructureDefinition.
* @param theRequiredOnly If true (default: false), the questionnaire will only include those elements marked as "min>0" in the StructureDefinition.
* @param theSubject The subject(s) that is/are the target of the Questionnaire.
* @param theParameters Any input parameters defined in libraries referenced by the StructureDefinition.
* @param theUseServerData Whether to use data from the server performing the evaluation.
* @param theData Data to be made available during CQL evaluation.
* @param theDataEndpoint An endpoint to use to access data referenced by retrieve operations in libraries
* referenced by the StructureDefinition.
* @param theContentEndpoint An endpoint to use to access content (i.e. libraries) referenced by the StructureDefinition.
* @param theTerminologyEndpoint An endpoint to use to access terminology (i.e. valuesets, codesystems, and membership testing)
* referenced by the StructureDefinition.
* @param theRequestDetails The details (such as tenant) of this request. Usually
* autopopulated HAPI.
* @return The questionnaire form generated based on the StructureDefinition.
*/
@Operation(name = ProviderConstants.CR_OPERATION_QUESTIONNAIRE, idempotent = true, type = StructureDefinition.class)
public Questionnaire questionnaire(
@IdParam IdType theId,
@OperationParam(name = "profile") StructureDefinition theProfile,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "supportedOnly") BooleanType theSupportedOnly,
@OperationParam(name = "requiredOnly") BooleanType theRequiredOnly,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails) {
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return (Questionnaire) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.generateQuestionnaire(
Eithers.for3(canonicalType, theId, theProfile),
theSupportedOnly == null ? Boolean.FALSE : theSupportedOnly.booleanValue(),
theRequiredOnly == null ? Boolean.FALSE : theRequiredOnly.booleanValue(),
theSubject,
theParameters,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint,
null);
}
@Operation(name = ProviderConstants.CR_OPERATION_QUESTIONNAIRE, idempotent = true, type = StructureDefinition.class)
public Questionnaire questionnaire(
@OperationParam(name = "profile") StructureDefinition theProfile,
@OperationParam(name = "canonical") String theCanonical,
@OperationParam(name = "url") String theUrl,
@OperationParam(name = "version") String theVersion,
@OperationParam(name = "supportedOnly") BooleanType theSupportedOnly,
@OperationParam(name = "requiredOnly") BooleanType theRequiredOnly,
@OperationParam(name = "subject") String theSubject,
@OperationParam(name = "parameters") Parameters theParameters,
@OperationParam(name = "useServerData") BooleanType theUseServerData,
@OperationParam(name = "data") Bundle theData,
@OperationParam(name = "dataEndpoint") Endpoint theDataEndpoint,
@OperationParam(name = "contentEndpoint") Endpoint theContentEndpoint,
@OperationParam(name = "terminologyEndpoint") Endpoint theTerminologyEndpoint,
RequestDetails theRequestDetails) {
CanonicalType canonicalType = getCanonicalType(FhirVersionEnum.R4, theCanonical, theUrl, theVersion);
return (Questionnaire) myQuestionnaireProcessorFactory
.create(theRequestDetails)
.generateQuestionnaire(
Eithers.for3(canonicalType, null, theProfile),
theSupportedOnly == null ? Boolean.FALSE : theSupportedOnly.booleanValue(),
theRequiredOnly == null ? Boolean.FALSE : theRequiredOnly.booleanValue(),
theSubject,
theParameters,
theData,
theUseServerData == null ? Boolean.TRUE : theUseServerData.booleanValue(),
theDataEndpoint,
theContentEndpoint,
theTerminologyEndpoint,
null);
}
}

View File

@ -19,10 +19,11 @@ public class PlanDefinitionOperationsProviderTest extends BaseCrR4TestServer {
loadBundle("ca/uhn/fhir/cr/r4/Bundle-PatientData.json");
var requestDetails = setupRequestDetails();
var planDefinitionID = new IdType(Enumerations.FHIRAllTypes.PLANDEFINITION.toCode(), "ASLPA1");
var url = "http://example.org/sdh/dtr/aslp/PlanDefinition/ASLPA1";
var version = "1.0.0";
var patientID = "positive";
var parameters = new Parameters().addParameter("Service Request Id", "SleepStudy").addParameter("Service Request Id", "SleepStudy2");
var result = (CarePlan) myPlanDefinitionApplyProvider.apply(planDefinitionID, null, null, patientID,
var result = (CarePlan) myPlanDefinitionApplyProvider.apply(null, null, null, url, version, patientID,
null, null, null, null, null,
null, null, null, parameters, new BooleanType(true), null,
null, null, null,
@ -35,7 +36,7 @@ public class PlanDefinitionOperationsProviderTest extends BaseCrR4TestServer {
.getItem().get(0)
.getText());
var resultR5 = (Bundle) myPlanDefinitionApplyProvider.applyR5(planDefinitionID, null, null, patientID,
var resultR5 = (Bundle) myPlanDefinitionApplyProvider.applyR5(null, null, null, url, version, patientID,
null, null, null, null, null,
null, null, null, parameters, new BooleanType(true), null,
null, null, null,

View File

@ -3,6 +3,7 @@ package ca.uhn.fhir.cr.r4;
import ca.uhn.fhir.cr.r4.questionnaire.QuestionnairePackageProvider;
import ca.uhn.fhir.cr.r4.questionnaire.QuestionnairePopulateProvider;
import org.hl7.fhir.r4.model.BooleanType;
import org.hl7.fhir.r4.model.Enumerations;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Parameters;
@ -28,7 +29,7 @@ public class QuestionnaireOperationsProviderTest extends BaseCrR4TestServer {
var theSubject = "positive";
var parameters = new Parameters().addParameter("Service Request Id", "SleepStudy").addParameter("Service Request Id", "SleepStudy2");
var result = myQuestionnairePopulateProvider.populate(new IdType("Questionnaire", "ASLPA1"),
null, null, theSubject, parameters,
null, null, null, null, theSubject, parameters, null, null,
null, null, null, null,
requestDetails);
@ -45,7 +46,7 @@ public class QuestionnaireOperationsProviderTest extends BaseCrR4TestServer {
var theSubject = "positive";
var parameters = new Parameters().addParameter("Service Request Id", "SleepStudy").addParameter("Service Request Id", "SleepStudy2");
var result = myQuestionnairePopulateProvider.prepopulate(new IdType("Questionnaire", "ASLPA1"),
null, null, theSubject, parameters,
null, null, null, null, theSubject, parameters, null, null,
null, null, null, null,
requestDetails);
@ -58,7 +59,7 @@ public class QuestionnaireOperationsProviderTest extends BaseCrR4TestServer {
loadBundle("ca/uhn/fhir/cr/r4/Bundle-QuestionnairePackage.json");
var requestDetails = setupRequestDetails();
var result = myQuestionnairePackageProvider.packageQuestionnaire(null,
"http://example.org/sdh/dtr/aslp/Questionnaire/ASLPA1", "true",
"http://example.org/sdh/dtr/aslp/Questionnaire/ASLPA1", null, null, new BooleanType("true"),
requestDetails);
assertNotNull(result);

View File

@ -21,7 +21,7 @@ public class QuestionnaireResponseOperationsProviderTest extends BaseCrR4TestSer
var requestDetails = setupRequestDetails();
loadResource(Questionnaire.class, "ca/uhn/fhir/cr/r4/Questionnaire-MyPainQuestionnaire.json", requestDetails);
var questionnaireResponse = readResource(QuestionnaireResponse.class, "ca/uhn/fhir/cr/r4/QuestionnaireResponse-QRSharonDecision.json");
var result = (Bundle) myQuestionnaireResponseExtractProvider.extract(null, questionnaireResponse, requestDetails);
var result = (Bundle) myQuestionnaireResponseExtractProvider.extract(null, questionnaireResponse, null, null, requestDetails);
assertNotNull(result);
assertEquals(5, result.getEntry().size());

View File

@ -49,7 +49,6 @@ public class TestCrR4Config {
@Bean
CareGapsProperties careGapsProperties() {
var careGapsProperties = new CareGapsProperties();
careGapsProperties.setThreadedCareGapsEnabled(false);
careGapsProperties.setCareGapsReporter("Organization/alphora");
careGapsProperties.setCareGapsCompositionSectionAuthor("Organization/alphora-author");
return careGapsProperties;

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.1.6-SNAPSHOT</version>
<version>7.1.7-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Some files were not shown because too many files have changed in this diff Show More