-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/HL7/fhir-ig-publisher
- Loading branch information
Showing
14 changed files
with
423 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# IG Publisher User Documentation | ||
|
||
## Introduction | ||
|
||
This is the documentation for the IG Publisher. | ||
|
||
## IG Requirements | ||
|
||
Supported Implementation Guides that the IG publisher can publish are always contained in directories that | ||
contain a file named ```ig.ini``` with the following content: | ||
|
||
```ini | ||
[IG] | ||
ig = {path} | ||
template = {template-id} | ||
``` | ||
Other entries are allowed, but not used by the IG-Publisher. ig - the path to the ImplementationGuide resource | ||
that defines. | ||
|
||
You can either run the Publisher with a default directory of the folder that contains the ig.ini, or use the ```-ig``` parameter. | ||
|
||
See [Location?](todo) for documentation about the content of the IG to be built. | ||
|
||
## Command Line Parameters | ||
|
||
Run mode: | ||
* ```-help``` - produce the command line help | ||
* ```-go-publish`` - publication mode, see below` | ||
* ```-gui``` - run the GUI (not really supported) | ||
|
||
Command line build mode parameters | ||
* ```-ig``` {folder} - the folder that contains the IG | ||
* ```-prompt``` - ask which ig to run (default to last) | ||
* ```-source``` - run with standard template. this is publishing lite (just a set of conformance resource, IG publisher autobuilds an IG) ?supported | ||
* ```-fhir-settings``` - see next section | ||
* ```-debug``` - turn on debugging (extra logging, can be verbose) | ||
* ```-proxy``` - proxy to use if it must be set manually (host:port) | ||
* ```-tx``` - alternative tx server to tx.fhir.org (but still most be the same software, see [running your own copy of tx.fhir.org](https://confluence.hl7.org/display/FHIR/Running+your+own+copy+of+tx.fhir.org)) | ||
* ```-no-network``` - turn of all network access - any attempt to use the network will generate an error (offline build mode) | ||
* ```-no-sushi``` - don't run sushi before build IG (if it's there to be run) | ||
* ```-generation-off``` - turn narrative generation off completely to make for faster local run time | ||
* ```-no-narrative``` - comma list of resources (type/id) to not generate narrative for (e.g. faster run) | ||
* ```-validation-off``` - turn validation off completely to make for faster local run time | ||
* ```-no-validate``` - comma list of resources (type/id) to not validate (e.g. faster run) | ||
* ```-resetTx``` - clear the local terminology cache before running | ||
* ```-resetTxErrors``` - remove any errors from the local cache but leave other content there | ||
* ```-auto-ig-build``` - used by the ci-build (see below) to switch on some ci-build integration features | ||
* ```-simplifier``` - used by simplifier when running the IG publisher internally (under development) | ||
* ```-jekyll``` - path to Jekyll (but use config, see below) | ||
* ```-cacheVersion``` - ?not supported anymore? | ||
* ```-spec``` - path to old spec file (deprecated and not supported) | ||
* ```-publish``` - ?not supported anymore? | ||
|
||
## Configuration File | ||
|
||
## Go Publish | ||
|
||
(todo) | ||
|
||
## CI-build integration | ||
|
||
See https://github.com/FHIR/auto-ig-builder#quick-start-guide | ||
|
||
## UI mode | ||
|
||
This exists but isn't well documented. | ||
|
||
## Shell Integration | ||
|
||
### Windows | ||
|
||
To do | ||
|
||
### OSX | ||
|
||
To do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/CodeSystemValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package org.hl7.fhir.igtools.publisher; | ||
|
||
/* | ||
Copyright (c) 2011+, HL7, Inc. | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name of HL7 nor the names of its contributors may be used to | ||
endorse or promote products derived from this software without specific | ||
prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
|
||
|
||
import java.util.ArrayList; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import org.hl7.fhir.r5.context.IWorkerContext; | ||
import org.hl7.fhir.r5.model.CodeSystem; | ||
import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; | ||
import org.hl7.fhir.r5.utils.XVerExtensionManager; | ||
import org.hl7.fhir.utilities.validation.ValidationMessage; | ||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; | ||
import org.hl7.fhir.validation.BaseValidator; | ||
|
||
/** | ||
* This is defunct, I think? All this checking happens in the main code system validator? | ||
* | ||
* @author grahamegrieve | ||
* | ||
*/ | ||
public class CodeSystemValidator extends BaseValidator { | ||
|
||
public CodeSystemValidator(IWorkerContext context, XVerExtensionManager xverManager) { | ||
super(context, xverManager, false); | ||
} | ||
|
||
public List<ValidationMessage> validate(CodeSystem cs, boolean forBuild) { | ||
List<ValidationMessage> errors = new ArrayList<ValidationMessage>(); | ||
|
||
// this is an invariant on CodeSystem, but the invariant is wrong in R3, and doesn't work | ||
checkCodesUnique(cs, errors); | ||
return errors; | ||
} | ||
|
||
private void checkCodesUnique(CodeSystem cs, List<ValidationMessage> errors) { | ||
Set<String> codes = new HashSet<String>(); | ||
checkCodes(codes, cs.getConcept(), "CodeSystem.where(id = '"+cs.getId()+"')", errors); | ||
} | ||
|
||
private void checkCodes(Set<String> codes, List<ConceptDefinitionComponent> list, String path, List<ValidationMessage> errors) { | ||
for (ConceptDefinitionComponent cc : list) { | ||
String npath = path+".concept.where(code = '"+cc.getCode()+"')"; | ||
if (codes.contains(cc.getCode())) { | ||
rule(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, npath, false, "Duplicate Code "+cc.getCode()); | ||
} | ||
codes.add(cc.getCode()); | ||
checkCodes(codes, cc.getConcept(), npath, errors); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.