adding base documentation
This commit is contained in:
@@ -2,9 +2,53 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### What they do...
|
When updating the supporting HAPI-FHIR version, or making changes to the JPA server starter code itself, it is sometimes
|
||||||
When updating the HAPI-FHIR version, or making changes to the JPA server starter code itself,
|
useful to run basic smoke tests to ensure the basic functionality of the server is maintained. The goal of these tests is
|
||||||
|
to provide users a quick way to run groups of tests that correspond to various sections within the
|
||||||
|
[HAPI-FHIR documentation][Link-HAPI-FHIR-docs].
|
||||||
|
|
||||||
### Requirements...
|
### Requirements
|
||||||
|
Tests are written in IntelliJ [HTTP Client Request files][Link-HTTP-Client-Req-Intro]. Ultimate edition of IntelliJ
|
||||||
|
is required to run these tests.
|
||||||
|
|
||||||
### How to run the smoke test...
|
For more details on integrated tooling and request syntax, there is [documentation available][Link-HTTP-Client-Req-Exploring]
|
||||||
|
on the jetbrains website, in addition to the [API reference][Link-HTTP-Client-Req-API].
|
||||||
|
|
||||||
|
### Formatting
|
||||||
|
As mentioned, each test file corresponds to a given section within the hapifhir documentation as close as possible. For
|
||||||
|
example, there is a `plain_server.rest` file, which attemps to smoke test all basic functionality outlined in the section
|
||||||
|
[within the docs][Link-HAPI-FHIR-docs-plain-server].
|
||||||
|
|
||||||
|
Individual tests are formatted as follows:
|
||||||
|
```javascript
|
||||||
|
### Test Title Here
|
||||||
|
# <link to relevant documentation>
|
||||||
|
REST-OPERATION ENDPOINT-URL
|
||||||
|
// Verification Steps
|
||||||
|
```
|
||||||
|
|
||||||
|
Users can setup custom environment variables for running tests locally against their own servers. This can be done by
|
||||||
|
adding environment information within the `http-client.env.json` file. By default, we provide the following:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"default": {
|
||||||
|
"host": "localhost:8080",
|
||||||
|
"username": "username",
|
||||||
|
"password": "password"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running the Tests
|
||||||
|
Within IntelliJ, right click the file you wish to run tests in and select the `Run All` option from the menu.
|
||||||
|
|
||||||
|
**Important:** Tests may not work individually when run. Often times, tests need to be run sequentially, as they depend
|
||||||
|
on resources/references from previous tests to complete. _(An example of this would be adding a Patient, saving the id,
|
||||||
|
then using that idea to test if we can successfully PATCH that Patient resource.)_
|
||||||
|
|
||||||
|
|
||||||
|
[Link-HAPI-FHIR-docs]: https://hapifhir.io/hapi-fhir/docs/
|
||||||
|
[Link-HAPI-FHIR-docs-plain-server]: https://hapifhir.io/hapi-fhir/docs/server_plain/server_types.html
|
||||||
|
[Link-HTTP-Client-Req-Intro]: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html
|
||||||
|
[Link-HTTP-Client-Req-Exploring]: https://www.jetbrains.com/help/idea/exploring-http-syntax.html
|
||||||
|
[Link-HTTP-Client-Req-API]: https://www.jetbrains.com/help/idea/http-response-handling-api-reference.html
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
### Create Single Patient
|
### Create Single Patient
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#create-type
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#type_create
|
||||||
POST http://{{host}}/fhir/Patient
|
POST http://{{host}}/fhir/Patient
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
< ../resources/smoketestfiles/patient_create.json
|
< smoketestfiles/patient_create.json
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
client.test("Patient created successfully", function() {
|
client.test("Patient created successfully", function() {
|
||||||
@@ -22,11 +22,11 @@ Content-Type: application/json
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Search Single Patient
|
### Search Single Patient
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#search
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#type_search
|
||||||
GET http://{{host}}/fhir/Patient?name={{single_patient_family_name}}&_id={{single_patient_id}}
|
GET http://{{host}}/fhir/Patient?name={{single_patient_family_name}}&_id={{single_patient_id}}
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
client.test("Patient created successfully", function() {
|
client.test("Patient search successful", function() {
|
||||||
client.assert(response.status === 200, "Response status is not 200");
|
client.assert(response.status === 200, "Response status is not 200");
|
||||||
});
|
});
|
||||||
client.test("Response content-type is json", function() {
|
client.test("Response content-type is json", function() {
|
||||||
@@ -44,7 +44,7 @@ GET http://{{host}}/fhir/Patient?name={{single_patient_family_name}}&_id={{singl
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Delete Patient
|
### Delete Patient
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#delete-instance
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#instance_delete
|
||||||
DELETE http://{{host}}/fhir/Patient/{{single_patient_id}}
|
DELETE http://{{host}}/fhir/Patient/{{single_patient_id}}
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
@@ -62,11 +62,11 @@ DELETE http://{{host}}/fhir/Patient/{{single_patient_id}}
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Batch Patient Create
|
### Batch Patient Create
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#transaction-server
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#system_transaction
|
||||||
POST http://{{host}}/fhir/
|
POST http://{{host}}/fhir/
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
< ../resources/smoketestfiles/patient_batch_create.json
|
< smoketestfiles/patient_batch_create.json
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
client.test("Bundle transaction completed successfully", function() {
|
client.test("Bundle transaction completed successfully", function() {
|
||||||
@@ -93,11 +93,11 @@ Content-Type: application/json
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Update - Instance
|
### Update - Instance
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#update-instance
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#instance_update
|
||||||
PUT http://{{host}}/fhir/Patient/{{batch_patient_id}}
|
PUT http://{{host}}/fhir/Patient/{{batch_patient_id}}
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
< ../resources/smoketestfiles/patient_update.json
|
< smoketestfiles/patient_update.json
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
client.test("Bundle transaction completed successfully", function() {
|
client.test("Bundle transaction completed successfully", function() {
|
||||||
@@ -122,11 +122,11 @@ Content-Type: application/json
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Patch - Instance
|
### Patch - Instance
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#patch-instance
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#instance-level-patch
|
||||||
PATCH http://{{host}}/fhir/Patient/{{batch_patient_id}}
|
PATCH http://{{host}}/fhir/Patient/{{batch_patient_id}}
|
||||||
Content-Type: application/json-patch+json
|
Content-Type: application/json-patch+json
|
||||||
|
|
||||||
< ../resources/smoketestfiles/patient_patch.json
|
< smoketestfiles/patient_patch.json
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
client.test("Patch operation completed successfully", function() {
|
client.test("Patch operation completed successfully", function() {
|
||||||
@@ -147,7 +147,7 @@ Content-Type: application/json-patch+json
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### History - Server/Type/Instance
|
### History - Server/Type/Instance
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#history-servertypeinstance
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#history
|
||||||
GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/_history
|
GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/_history
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
@@ -169,7 +169,7 @@ GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/_history
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Capability Statement
|
### Capability Statement
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#capability-statement-metadata-server
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations.html#system_capabilities
|
||||||
GET http://{{host}}/fhir/metadata
|
GET http://{{host}}/fhir/metadata
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
@@ -187,7 +187,7 @@ GET http://{{host}}/fhir/metadata
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Extended Operations - everything
|
### Extended Operations - everything
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#extended-operations
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_operations.html
|
||||||
GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/$everything
|
GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/$everything
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
@@ -205,7 +205,7 @@ GET http://{{host}}/fhir/Patient/{{batch_patient_id}}/$everything
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
### Extended Operations - validate
|
### Extended Operations - validate
|
||||||
# https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#extended-operations
|
# https://hapifhir.io/hapi-fhir/docs/server_plain/rest_operations_operations.html
|
||||||
POST http://{{host}}/fhir/Patient/{{batch_patient_id}}/$validate
|
POST http://{{host}}/fhir/Patient/{{batch_patient_id}}/$validate
|
||||||
|
|
||||||
> {%
|
> {%
|
||||||
|
|||||||
Reference in New Issue
Block a user