diff --git a/Gazelle-Objects-Checker/release-note.md b/Gazelle-Objects-Checker/release-note.md index b3805ea9989ec1c3f1941a232d1da3af1c178ca8..659c344ed6361249a967ed3272baea66ce6c19e3 100644 --- a/Gazelle-Objects-Checker/release-note.md +++ b/Gazelle-Objects-Checker/release-note.md @@ -1,13 +1,34 @@ --- title: Release note subtitle: Gazelle Objects Checker -toolversion: 3.0.4 -releasedate: 2022-04-20 +toolversion: 3.1.0 +releasedate: 2022-06-29 author: Nabila AAZIBOU EL GERRAB function: JAVA development intern customer: IHE Europe reference: KER1-RNO-IHE-GOC --- + +#3.1.0 + +_Release date: 2022-06-29_ + +__Improvement__ +* \[[GOC-208](https://gazelle.ihe.net/jira/browse/GOC-208)\] Review functional & technical "Choices" implementation in GOC +* \[[GOC-209](https://gazelle.ihe.net/jira/browse/GOC-209)\] Choices Functional analysis + +__Bug__ +* \[[GOC-235](https://gazelle.ihe.net/jira/browse/GOC-235)\] Issues with CDA validatiors Wave 6 generation + +__Task__ +* \[[GOC-203](https://gazelle.ihe.net/jira/browse/GOC-203)\] Schematron Validation with GOC Analysis +* \[[GOC-224](https://gazelle.ihe.net/jira/browse/GOC-224)\] Verify HL7 Rules for ANS MBVal +* \[[GOC-223](https://gazelle.ihe.net/jira/browse/GOC-223)\] Identify wrong raised errors compared to Schematron +* \[[GOC-206](https://gazelle.ihe.net/jira/browse/GOC-206)\] GOC System Testing + + + + # 3.0.4 _Release date: 2022-04-20_ diff --git a/Gazelle-Objects-Checker/user.md b/Gazelle-Objects-Checker/user.md index bf9c221e5ccbc77f8281fb2abe16553e9f666608..684aebefa54a96dc50c1a887c650ecfc516749c9 100644 --- a/Gazelle-Objects-Checker/user.md +++ b/Gazelle-Objects-Checker/user.md @@ -17,29 +17,31 @@ date: 19/10/2021 7. ##### [Generation Validator form UML (Alternative)](#generateValidatorFromUML) 8. ##### [Validate CDA](#validateCDA) 9. ##### [Utility Scripts](#utilityScripts) -10. ##### [Extras](#extras) +10. ##### [System Testing](#systemTesting) +11. ##### [Extras](#extras) -<div id='introduction'/> +<div id='introduction'></div> ## 1. Introduction -In this guide, we will show how to retrieve the new version of **Gazelle Objects Cheker**, -build it and generate a CDA Validator in a generic case, and client specific case +In this guide, we will show how to retrieve the new version of **Gazelle Objects Cheker**, +build it and generate a CDA Validator in a generic case, and client specific case **Requirements:** - **JDK 11** or higher -- Maven **3.5.x** /!\ You need to respect this version, or the tool won't work +- Maven **3.5.x** /!\ You need to respect this version, or the tool won't work - Thanks to maven wrapper, this version is packaged now with GOC, you can find it in `gazelle-objects-checker/hl7templates/hl7templates-packager-jar/src/main/resources/maven-wrapper` - Git -<div id='cloneProject'/> +<div id='cloneProject'></div> -## 2. Clone Project +## 2. Clone Project the project is not maintained by the _forge_ anymore.<br> Gazelle Objects Checker has been migrated to **[Gitlab](https://gitlab.inria.fr)** and packaged under one module called **gazelle-objects-checker**<br> If you worked already with the previous versions of GOC, the following structure could be familiar to you: - Archetypes - generated-validator - Hl7templates + - goc-tests - gocmodel-jar - hl7templates-model-jar - hl7templates-api-jar @@ -56,7 +58,7 @@ If you worked already with the previous versions of GOC, the following structure - voc-model In the current version `3.x.x`, the `Archtypes` and `Hl7templates` modules _(with all their submodules)_ are packaged in one module `Gazelle Objects Checker` <br> -The resources models are packaged in a module called `UML Models`. +The resources models are packaged in a module called `UML Models`. <table> <thead> @@ -86,13 +88,13 @@ Run the following command: > Notice: the installation of gazelle-objects-checker will be done in the [Generate Artifact](#generateArtifact) section.<br> You can skip tests if you want, but it's not recommend. -> +> > You don't have to install the `uml-models` module, it's already released -<div id='runTests'/> +<div id='runTests'></div> ## 3. Run Tests (Optional) @@ -123,10 +125,10 @@ If Something went wrong, make sure you have mentioned in maven logs: If not, try to run the creation resources script `CreateResourcesForTest.java` in: - _gazelle-objects-checker/gocmodel-jar/src/main/java/net.ihe.gazelle.goc.script_ -<div id='prepareBBR'/> +<div id='prepareBBR'></div> ## 4. Prepare BBR -BBR is an abbreviation of Building Block Repository, a large XML file containing all the functional specifications, +BBR is an abbreviation of Building Block Repository, a large XML file containing all the functional specifications, that will be used by GOC to generate OCL which is converted finally to a Java validator.<br> So Basically, the BBR is considered as **the main input for GOC** @@ -137,7 +139,7 @@ To retrieve the project follow the link: >[https://gazellecontent.sequoiaproject.org/apps/decor/services/RetrieveProject](https://gazellecontent.sequoiaproject.org/apps/decor/services/RetrieveProject) Choose project as _**(BBR) Consolidated CDA (en-US)**_.<br> -Make sure to select the **_Compiled_** version. <br> +Make sure to select the **_Compiled_** version. <br> Then check the **_Download_** radio.<br> Press **_send_** button.<br> @@ -149,7 +151,7 @@ then change **ccda-** by **ccda(version)-** for example for version 2.1: NOTICE: A script could be released for this, due to performance issues -<div id='generateArtifact'/> +<div id='generateArtifact'></div> ## 5. Generate Artifact @@ -171,24 +173,46 @@ The Artifact is generated at _**gazelle-objects-checker/hl7templates-packager-ja > > _**HINT**_: if you still have compile errors, you can install just the archetypes module (as it's required at runtime) with: -> +> > ```bash > cd gazelle-objects-checker/archetype/generated-validator > > mvn clean install > ``` -> +> > And retrieve GOC Artifact from nexus. -> +> > here: [GOC Artifact Nexus](https://gazelle.ihe.net/nexus/#nexus-search;quick~hl7templates-packager) -> Choose the latest version, and download the: **hl7templates-packager-jar-X.X.X-jar-with-dependencies.jar** artifact +> Choose the latest version, and download the: **hl7templates-packager-jar-X.X.X-jar-with-dependencies.jar** artifact + +### Generate tests coverage report: + +#### Overview: +Some Tests methods in GOC, are annotated with `@Covers` annotation (GOC Specific), +these methods tests a given HL7 Specification, these annotations are used later to generate a coverd +report if requested. + +#### Usage +You can generate a coverage report of all covered HL7 specifications by GOC, with passing the +following parameters during install process: +- `-Dcsv`: Path to a CSV that will aggregate all +- `-Ddest`: Destination path to generated XML report +- `-Dtype`: (OPTIONAL) Report type (Only XML is available so far, which is the default one) + +> Notice: if one of the first parameters is missing, coverage report not generated, but packagin +> should be done succcessfully -<div id='generateValidator'/> +/!\ Be careful to not generate the coverage with same csv file, because it will aggregate with old results + +<div id='generateValidator'></div> ## 6. Generate Validator -This section remains to **run** Gazelle Objects Checker and generate the CDA MBVal validator. +This section remains to **run** Gazelle Objects Checker and generate the CDA MBVal validator. + +we will need the following parameters to run GOC and generate the validator: + + -we will need the following parameters to run GOC and generate the validator: <table> <thead> <th>Parameters</th> @@ -222,14 +246,14 @@ we will need the following parameters to run GOC and generate the validator: <td>-serviceName</td> <td>Validation Service Name</td> <td>String</td> - <td>Pivot</td> + <td>Pivot (for dgsante)</td> <td>not Required</td> </tr> <tr> <td>-HL7TEMP_CDACONFFOLDERNAME </td> <td>HL7template CDA config folder name</td> <td>cdabasic or cdaepsos</td> - <td>cdaepsos</td> + <td>cdaepsos (for dgsante)</td> <td>not Required (default=cdabasic)</td> </tr> <tr> @@ -250,21 +274,7 @@ we will need the following parameters to run GOC and generate the validator: <td>-versionLabel</td> <td>VersionLabel that will be used during the generation</td> <td>String</td> - <td>2.1</td> - <td>not Required</td> - </tr> - <tr> - <td>-rootClassName</td> - <td><i>DEPRECATED:</i>Root class name of generated classes</td> - <td>Path to java class (see example)</td> - <td>net.ihe.gazelle.cdaepsos3.POCDMT000040ClinicalDocument</td> - <td>not Required</td> - </tr> - <tr> - <td>-HL7TEMP_RESOURCES_PATH</td> - <td><i>DEPRECATED</i>: Path to hl7templates resources folder</td> - <td>String</td> - <td>/home/mylap/Documents/hl7templates-resources</td> + <td>2.1 or 1.1 (for SEQUOIA)</td> <td>not Required</td> </tr> </table> @@ -295,7 +305,7 @@ Example with SEQUOIA: **For logs:** > Go to the root folder of the provided output path, then logs/logs-[generation_date_time] -> +> > `cd /home/mylap/Documents/GOC-OUTPUT/logs/logs-[generation_date_time]` **Logs are separated as follows:** @@ -304,11 +314,11 @@ Example with SEQUOIA: - **cmdOutput.log:** contains the Standard Output of executed commands during generation (maven command to init project with archetype, generate code from OLC, packaging...) - **cdeModelsErrors.txt:** contains all detected inconsistencies between the provided BBR and pre-defined models used by GOC - + -<div id='generateValidatorFromUML' /> +<div id='generateValidatorFromUML'></div> -## 7. Generate Validator from UML (Alternative) +## 7. Generate Validator from UML (Alternative) This section is just an alternative way to regenerate the validator when the functional specifications change without re-running GOC, but just from the generated ```model.uml``` file. @@ -326,7 +336,7 @@ Then you can edit it with a Text Editor, or a dedicated modeling tool (ex: TopCa **After saving your model, you need to:** -Go to GOC-OUTPUT/epsos5-validator-jar and do the following: +Go to GOC-OUTPUT/epsos5-validator-jar and do the following: ```bash > cd /home/mylap/Documents/GOC-OUTPUT/validator/epsos5-validator-jar > mvn exec:exec@generateValidator -DmvnPath="/opt/apache-maven-3.5.4/bin/mvn" -DcdaProps="cdaepsos" -DprojectName="epsos5" @@ -340,7 +350,7 @@ The generic form of the command is: ``` Your validator will be available at: GOC-OUTPUT/epsos5-validator-jar/target/appassembler/bin -and do the following: +and do the following: ```bash > cd /home/mylap/Documents/GOC-OUTPUT/epsos5-validator-jar/target/appassembler/bin @@ -352,7 +362,7 @@ Now you can refer to [Section 8](#validateCDA) to Validate a CDA document with y -<div id='validateCDA'/> +<div id='validateCDA'></div> ## 8. Validate CDA @@ -362,7 +372,7 @@ We will suppose we generated a validator with a BBR containing the following ver Open the following directory: ```bash -> cd <Path_To_Output>/epsos5-validator-app/bin +> cd <Path_To_Output>/validator/epsos-validator-app/bin > chmod +x validator.sh #if on linux @@ -376,7 +386,7 @@ For SEQUOIA with version ccda21, you need to adapt it to SVS first, and for that # or just for adapting SVS you can use the SEQUOIASVSAdaptation.sh ``` -Then: +Then: ```bash > cd <Path_To_Output>/ccda21-validator-jar/target/appassembler/bin @@ -433,7 +443,7 @@ Here is a summary of possible parameters for the validator: </table> -Here is an example to validate a document with normal case: +Here is an example to validate a document with normal case: ```bash > ./validator.sh -path /home/mylap/eHDSI_CDA.xml -out ../../results1.xml @@ -445,7 +455,7 @@ If you got some errors related to the XSD Validation, you can adapt your XSD at: cd <Path_To_Output>/epsos5-validator-app/bin/resources/valresources/xsd.<br> ``` -If you want to test the generated validator, you can use the provided SoapUI project provided in: +If you want to test the generated validator, you can use the provided SoapUI project provided in: > gazelle-objects-checker/testing/MBValGOC-soapui-project.xml @@ -453,15 +463,26 @@ Just import it to SoapUI and run the test cases. -<div id='utilityScripts'/> +<div id='utilityScripts'></div> + +## 9. Test GOC with default BBR and CDA +If you want to test goc with a default bbr and cda: +Path to bbr file: +```bash +gazelle-objects-checker/hl7templates/goc-tests/goc-tests-runner/src/main/resources/global/decor_global.xml +``` +Path to cda file: +```bash +gazelle-objects-checker/hl7templates/goc-tests/goc-tests-runner/src/main/resources/global/cda_global.xml +``` -## 9. Utility Scripts +## 10. Utility Scripts As we saw in the previous section: [Generate Validator](#generateValidator), there is too many options to remember for generating a validator.<br> -Therefore, that decreases the usability of the tool, so we created some utility scripts for both common generation types: +Therefore, that decreases the usability of the tool, so we created some utility scripts for both common generation types: - CDA Epsos Generation (for eHDSI) -- CDA Basic Generation (for Sequoia Project) +- CDA Basic Generation (for Sequoia Project) > /!\ You need to set **$JAVA_HOME** before running the script, or override it inside. @@ -473,27 +494,93 @@ You can find the scripts directly in the **target** directory: ``` And just follow the instructions shown by the interactive script. ->HINT: if the script doesn't work, try: +>HINT: if the script doesn't work, try: > ```bash > chmod +x eHDSIGeneration.sh > ``` > **And re-run it** -For SEQUOIA: +For SEQUOIA: ```bash > cd gazelle-objects-checker/hl7templates/hl7templates-packager-jar/target > ./SEQUOIAGeneration.sh ``` +<div id='systemTesting'></div> -<div id='extras'/> +## 11. System Testing +### Overview: +Due to the variety of the HL7 specifications handled by GOC, and the Conversion & Generation processes +that it executed, we created a new module to perform a System Test for all known (i.e main) rules by GOC. +Each specification has its own _DECOR_, _CDA_ and _Expected Results_ for comparaison.<br> +The following specifications are supported so far by GOC System Testing module: +- Cardinality +- Mandatory +- Vocabulary +- Context +- Datatype +- Fixed Value +- **GLOBAL**** -## 10. Extras +** The **_Global_** type is not a specification, but a pre-defined profile with _DECOR_, _CDA_ and _Expected Results_ +that contains all other specifications, for a general system testing. -You can find some previous made documentation here _(belong the old GOC, and could probably not represent the actual version)_: -- [GOC Installation guide for developers](https://docs.google.com/document/d/1G5bmLhFKNjOvg_rxEllidTofYrwxBeZG_kigTM0pqXM/edit?usp=sharing) +### Configuration +Before using the provided APIs, you need to make a basic configuration in: +- `application.properties`<br> + +Required properties to be set: +- `maven.path`: The binary path to your maven installation (you can reference the wrapped one) +- `result.type`: **xml** for xml generated report or **standard** for console output +- `result.type.xmlpath`: You need to set a path if the `result.type` is set to XML + +Optional properties (could keep the default value): +- `goc.persistValidator`: set to true if you want to keep the generated validator during the test +- `goc.persistResult`: set to true if you want to keep the validation result during test + +**NOT RECOMMENDED** to change: +- `goc.outputFolderPrefix`: prefix of the generation folder +- `goc.resultFolderPrefix`: prefix for the results folder + +### Usage: +####11.1 From IDE with JUnit + +The module have an integrated interface with JUnit annotations, with pre-defined assertions (that could be overriden +by the use), so could easly be executed from your IDE. +The main Test Class called `SystemTest` at +`hl7templates/goc-tests/goc-tests-runner/src/test/java/net/ihe/gazelle/goctests/SystemTests.java` + +####11.2 From Command Line Interface +The module provides a user-friendly CLI with one parameter `-S` or `--spec-type` +The executable jar in `hl7templates/goc-tests/goc-tests-runner/target/goc-tests-runner-[X.X.X]-jar-with-dependencies.jar` + +```bash +> java -jar goc-tests-runner-[X.X.X]-jar-with-dependencies.jar --spec-type <SPECIFICATION> +``` + +Available options for `SPECIFICATION` are: +- cardinality +- mandatory +- vocabulary +- context +- datatype +- "fixed value" +- global + +<div id='extras'></div> + +####11.3 GOC System Testing guide for developers + +You can find more details about System Testing: +- [GOC System Testing guide for developers](https://saskereval-my.sharepoint.com/:w:/g/personal/nabila_aazibou-el-gerrab_kereval_com/EfRES8rEmoVEt0Ty2NPnljMBPfmnWWdJ02YjJw_x-xTPWA?e=wk0EJM) + + +## 12. Extras + +You can find some previous made documentation here _(belong the old GOC, and could probably not represent the actual version)_: - [Gazelle Object Checker General Public info - GOC](https://docs.google.com/document/d/1265YcvKk983Fna2Y8TI6V9O1wnKqERFAibIlVGYgW20/edit?usp=sharing) +- [GOC Installation guide for developers](https://docs.google.com/document/d/1G5bmLhFKNjOvg_rxEllidTofYrwxBeZG_kigTM0pqXM/edit?usp=sharing) #### Next released documentation