diff --git a/docs/installation-guide.md b/docs/installation-guide.md index 7111cbe38d6994931eee66a97ab5eccb2be1edc6..648dbdba57fd8a79e5320c594cb301d83b78e84a 100644 --- a/docs/installation-guide.md +++ b/docs/installation-guide.md @@ -11,15 +11,15 @@ date: 19/10/2021 1. ##### [Introduction](#introduction) 2. ##### [Clone Project](#cloneProject) 3. ##### [Run Tests (Optional)](#runTests) -4. ##### [Generate Artifact](#generateArtifact) -5. ##### [Prepare BBR](#prepareBBR) +4. ##### [Prepare BBR](#prepareBBR) +5. ##### [Generate Artifact](#generateArtifact) 6. ##### [Generate Validator](#generateValidator) 7. ##### [Generation Validator form UML (Alternative)](#generateValidatorFromUML) 8. ##### [Validate CDA](#validateCDA) 9. ##### [Utility Scripts](#utilityScripts) 10. ##### [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**, @@ -31,7 +31,7 @@ build it and generate a CDA Validator in a generic case, and client specific cas - 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 the project is not maintained by the _forge_ anymore.<br> @@ -92,7 +92,7 @@ You can skip tests if you want, but it's not recommend. -<div id='runTests'/> +<div id='runTests'></div> ## 3. Run Tests (Optional) @@ -123,7 +123,7 @@ 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, @@ -149,7 +149,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='generateArtifacts'/> +<div id='generateArtifact'></div> ## 5. Generate Artifact @@ -183,7 +183,7 @@ The Artifact is generated at _**gazelle-objects-checker/hl7templates-packager-ja > 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 -<div id='generateValidator'/> +<div id='generateValidator'></div> ## 6. Generate Validator This section remains to **run** Gazelle Objects Checker and generate the CDA MBVal validator. @@ -304,9 +304,9 @@ 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) @@ -314,12 +314,12 @@ This section is just an alternative way to regenerate the validator when the fun without re-running GOC, but just from the generated ```model.uml``` file. ```bash -> cd /home/mylap/Documents/GOC-OUTPUT/[validator-name]-validator-jar/model/[validator-name].uml +> cd /home/mylap/Documents/GOC-OUTPUT/validator/[validator-name]-validator-jar/model/[validator-name].uml ``` for example for epsos5 ```bash -> cd /home/mylap/Documents/GOC-OUTPUT/epsos5-validator-jar/model/epsos5.uml +> cd /home/mylap/Documents/GOC-OUTPUT/validator/epsos5-validator-jar/model/epsos5.uml ``` Then you can edit it with a Text Editor, or a dedicated modeling tool (ex: TopCased). @@ -328,7 +328,7 @@ Then you can edit it with a Text Editor, or a dedicated modeling tool (ex: TopCa Go to GOC-OUTPUT/epsos5-validator-jar and do the following: ```bash -> cd /home/mylap/Documents/GOC-OUTPUT/epsos5-validator-jar +> 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" > mvn clean package ``` @@ -352,14 +352,13 @@ 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 Now we are going to use the generated validator.<br> We will suppose we generated a validator with a BBR containing the following version: epsos5-.<br> -_We didn't use the SEQUOIA's BBR because the validator needs a hack (access to SVS) before it could be used_ Open the following directory: ```bash @@ -370,6 +369,23 @@ Open the following directory: > ./validator.sh -path <Path_to_CDA.xml> -out <Path_To_output_result.xml> ``` +For SEQUOIA with version ccda21, you need to adapt it to SVS first, and for that we have a generation script that handle all of that automatically: +```bash +> cd gazelle-objects-checker/hl7templates/hl7templates-packager-jar/target +> ./SEQUOIAGeneration.sh +# or just for adapting SVS you can use the SEQUOIASVSAdaptation.sh +``` + +Then: + +```bash +> cd <Path_To_Output>/ccda21-validator-jar/target/appassembler/bin + +> chmod +x validator.sh #if on linux + +> ./validator.sh -path <Path_to_CDA.xml> -out <Path_To_output_result.xml> +``` + Here is a summary of possible parameters for the validator: <table> <thead> @@ -437,7 +453,7 @@ Just import it to SoapUI and run the test cases. -<div id='utilityScripts'/> +<div id='utilityScripts'></div> ## 9. Utility Scripts @@ -470,7 +486,7 @@ For SEQUOIA: ``` -<div id='extras'/> +<div id='extras'></div> ## 10. Extras @@ -482,6 +498,5 @@ You can find some previous made documentation here _(belong the old GOC, and cou #### Next released documentation - Functional description of GOC -- Prepare validator for SEQUOIA -- Use interactive scripts for generation + diff --git a/hl7templates/hl7templates-model-jar/src/main/java/net/ihe/gazelle/tempmodel/decor/dt/utils/DTUtils.java b/hl7templates/hl7templates-model-jar/src/main/java/net/ihe/gazelle/tempmodel/decor/dt/utils/DTUtils.java index 2187df3b8a1e1d5e4e272037db801eb8ffd745f4..037b96632be1c0f095b281721452e82989cad4e5 100644 --- a/hl7templates/hl7templates-model-jar/src/main/java/net/ihe/gazelle/tempmodel/decor/dt/utils/DTUtils.java +++ b/hl7templates/hl7templates-model-jar/src/main/java/net/ihe/gazelle/tempmodel/decor/dt/utils/DTUtils.java @@ -109,7 +109,7 @@ public final class DTUtils { else { return false; } - return !realDTConstrained.equals(typeRD) && UMLLoader.verifyTheParentOfType1IsType2(realDTConstrained, typeRD); + return !realDTConstrained.equals(typeRD) && (UMLLoader.verifyTheParentOfType1IsType2(typeRD, realDTConstrained) || UMLLoader.verifyTheParentOfType1IsType2(realDTConstrained, typeRD)); } public static String cleanDTforIPS(String datatype){ diff --git a/hl7templates/hl7templates-packager-jar/src/main/resources/assemble-scripts/SEQUOIAGeneration.sh b/hl7templates/hl7templates-packager-jar/src/main/resources/assemble-scripts/SEQUOIAGeneration.sh index 9f3227809903d284a8a0804bdd0386934a6197b5..2361da4ee21eccf4ca506676af7b50e92efbdc2b 100755 --- a/hl7templates/hl7templates-packager-jar/src/main/resources/assemble-scripts/SEQUOIAGeneration.sh +++ b/hl7templates/hl7templates-packager-jar/src/main/resources/assemble-scripts/SEQUOIAGeneration.sh @@ -206,25 +206,28 @@ if [ ! -f ./SEQUOIASVSAdaptation.sh ]; then exit 1; fi; -pathToResources='' +# adapt only if version is higher than 1.1 +if [ "$versionLabel" != "1.1" ]; then + pathToResources='' -if [ ! -d ./classes/sequoia-db-hack ]; then - echo -e "${RED}Resources for adaptations not found, please provide a path manually" - read -r $pathToResources -else - pathToResources=$(realpath ./classes/sequoia-db-hack) -fi + if [ ! -d ./classes/sequoia-db-hack ]; then + echo -e "${RED}Resources for adaptations not found, please provide a path manually" + read -r $pathToResources + else + pathToResources=$(realpath ./classes/sequoia-db-hack) + fi -if [ ! -x ./SEQUOIASVSAdaptation.sh ]; then - chmod +x SEQUOIASVSAdaptation.sh -fi; + if [ ! -x ./SEQUOIASVSAdaptation.sh ]; then + chmod +x SEQUOIASVSAdaptation.sh + fi; -env JAVA_HOME=$JAVA_HOME M2_BIN=$mavenPath ./SEQUOIASVSAdaptation.sh "$workspaceDir/$folderName" $pathToResources + env JAVA_HOME=$JAVA_HOME M2_BIN=$mavenPath ./SEQUOIASVSAdaptation.sh "$workspaceDir/$folderName" $pathToResources -if [ $? != 0 ]; then - echo "${RED}Adaptations failed" - exit 1 -fi + if [ $? != 0 ]; then + echo "${RED}Adaptations failed" + exit 1 + fi +fi; #Zip validator #move to bin path diff --git a/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/POCD_MT000040_SDTC.xsd b/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/POCD_MT000040_SDTC.xsd index 14d11c8a6bdff13284183af89eeb2122a4ab7785..649306681dd460d3f02e9f85317d276875abda72 100644 --- a/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/POCD_MT000040_SDTC.xsd +++ b/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/POCD_MT000040_SDTC.xsd @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xs:schema targetNamespace="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif" xmlns="urn:hl7-org:v3" - xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" - xmlns:sdtc="urn:hl7-org:sdtc"> + xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" + xmlns:sdtc="urn:hl7-org:sdtc"> <!-- ***************************************************************************************************************** * XML schema for message type POCD_MT000040. @@ -35,16 +35,16 @@ --> <xs:annotation> <xs:documentation>Manually edited to add SDTC Schema Extension (authenticator/signatureText, legalAuthenticator/signatureText), 14 July 2013</xs:documentation> - <xs:documentation>Manually edited to add SDTC Schema Extensions, July 2012</xs:documentation> + <xs:documentation>Manually edited to add SDTC Schema Extensions, July 2012</xs:documentation> <xs:documentation>Generated using schema builder version 2.0. Stylesheets: -RoseTreeToMIFStaticModel.xsl version: 1.1 -StaticMifToXsd.xsl version 2.0</xs:documentation> + RoseTreeToMIFStaticModel.xsl version: 1.1 + StaticMifToXsd.xsl version 2.0</xs:documentation> </xs:annotation> <xs:include schemaLocation="processable/coreschemas/datatypes.xsd"/> <xs:include schemaLocation="processable/coreschemas/voc.xsd"/> <xs:include schemaLocation="processable/coreschemas/NarrativeBlock.xsd"/> - <xs:import namespace="urn:hl7-org:sdtc" schemaLocation="SDTC.xsd" /> -<xs:complexType name="POCD_MT000040.InfrastructureRoot.typeId"> + <xs:import namespace="urn:hl7-org:sdtc" schemaLocation="SDTC.xsd" /> + <xs:complexType name="POCD_MT000040.InfrastructureRoot.typeId"> <xs:complexContent> <xs:restriction base="II"> <xs:attribute name="root" type="uid" use="required" fixed="2.16.840.1.113883.1.3"/> @@ -916,6 +916,9 @@ StaticMifToXsd.xsl version 2.0</xs:documentation> <xs:element name="realmCode" type="CS" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="typeId" type="POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0"/> <xs:element name="templateId" type="II" minOccurs="0" maxOccurs="unbounded"/> + <!-- Begin Extension: (SDTC) --> + <xs:element ref="sdtc:functionCode" minOccurs="0" /> + <!-- End Extension: (SDTC) --> <xs:element name="time" type="IVL_TS" minOccurs="0"/> <xs:element name="awarenessCode" type="CE" minOccurs="0"/> <xs:element name="participantRole" type="POCD_MT000040.ParticipantRole"/> @@ -957,9 +960,9 @@ StaticMifToXsd.xsl version 2.0</xs:documentation> <xs:element name="raceCode" type="CE" minOccurs="0"/> <!-- Begin Extension: (SDTC) --> <xs:element ref="sdtc:raceCode" minOccurs="0" maxOccurs="unbounded"/> - <xs:element ref="sdtc:ethnicGroupCode" minOccurs="0" maxOccurs="unbounded"/> <!-- End Extension: (SDTC) --> <xs:element name="ethnicGroupCode" type="CE" minOccurs="0"/> + <xs:element ref="sdtc:ethnicGroupCode" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="guardian" type="POCD_MT000040.Guardian" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="birthplace" type="POCD_MT000040.Birthplace" minOccurs="0"/> <xs:element name="languageCommunication" type="POCD_MT000040.LanguageCommunication" minOccurs="0" maxOccurs="unbounded"/> @@ -999,6 +1002,9 @@ StaticMifToXsd.xsl version 2.0</xs:documentation> <xs:element name="realmCode" type="CS" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="typeId" type="POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0"/> <xs:element name="templateId" type="II" minOccurs="0" maxOccurs="unbounded"/> + <!-- Begin Extension: (SDTC) --> + <xs:element ref="sdtc:functionCode" minOccurs="0" /> + <!-- End Extension: (SDTC) --> <xs:element name="time" type="IVL_TS" minOccurs="0"/> <xs:element name="modeCode" type="CE" minOccurs="0"/> <xs:element name="assignedEntity" type="POCD_MT000040.AssignedEntity"/> diff --git a/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/SDTC.xsd b/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/SDTC.xsd index 5cbbdd020a3befeb228b77de0f2a0e1257aec240..b095d14e709c3cf95829233543153faa69c99d37 100644 --- a/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/SDTC.xsd +++ b/hl7templates/hl7templates-packager-jar/src/main/resources/sequoia-db-hack/xsd/SDTC.xsd @@ -53,6 +53,8 @@ <xs:element name="signatureText" type="hl7:ED"/> + <xs:element name="functionCode" type="hl7:CE" /> +