Unified Terminology Governance
hl7 / utg Goto Github PK
View Code? Open in Web Editor NEWUnified Terminology Governance
Unified Terminology Governance
I try to create a SimpleWorkerContext given a zip file on the classpath:
SimpleWorkerContext.fromClassPath(CORE_R4_FHIR_RESOURCES_FILENAME);
This results in a IOException: Stream closed
.
The reason is, my zip file (the Core R4 Profile) contains Json files, and the JsonParser closes the stream after parsing each zip entry, although more entries are available on the zip stream.
Explanation:
This method is looping through the entries in the zip file (which is perfectly fine):
SimpleWorkerContext:
private void loadFromStream(InputStream stream, IContextResourceLoader loader) throws IOException, FHIRException {
ZipInputStream zip = new ZipInputStream(stream);
ZipEntry ze;
while ((ze = zip.getNextEntry()) != null) {
loadDefinitionItem(ze.getName(), zip, loader);
zip.closeEntry();
}
zip.close();
}
The loadDefinitions()
calls the JsonParser, which in turn calls this:
TextFile:
public static String streamToString(InputStream input) throws IOException {
InputStreamReader sr = new InputStreamReader(input, "UTF-8");
StringBuilder b = new StringBuilder();
//while (sr.ready()) { Commented out by Claude Nanjo (1/14/2014) - sr.ready() always returns false - please remove if change does not impact other areas of codebase
int i = -1;
while((i = sr.read()) > -1) {
char c = (char) i;
b.append(c);
}
sr.close();
return b.toString().replace("\uFEFF", "");
}
This closes the InputStream, which causes the entire zip stream to be closed, causing everything to fail.
Also, reading a file byte for byte seems horribly inefficient!
I've been trying to figure out how terminology.hl7.org (which appears to be generated by the code in this repository) relates to https://tx.fhir.org and the hl7-terminology Node package. I have run the ./runonce.sh
script from this repo in Java 11 and successfully generated the documentation I see at https://terminology.hl7.org/, including the NPM packages on the download page at https://terminology.hl7.org/downloads.html. However, based on the output from that shell script, this code appears to access both tx.fhir.org ("Connect to Terminology Server at http://tx.fhir.org", "-tx: Connect to http://tx.fhir.org/r4") and possibly hl7-terminology ("Installing hl7.terminology#3.0.0 to the package cache", which I haven’t figured out where that is yet).
I would really appreciate some documentation on:
The reason I'm poking around with this is because I'd like to propose that FHIR CodeSystems and NamingSystems store the prefixes we need to convert a FHIR Coding (e.g. system: http://hl7.org/fhir/sid/icd-10, code: G44.1) to a concept URL (e.g. http://purl.bioontology.org/ontology/ICD10/G44.1) and vice versa. I'm doing this to solve a problem relating to FHIR RDF generation (see my latest comment on that issue here: w3c/hcls-fhir-rdf#94 (comment)), for which I'd like to be able to modify the hl7.terminology
NPM package to add a "prefix" field for a few CodingSystem/NodeSystem entries as an example.
Thanks so much for your help!
For all concept entries for "tables" that are actually v3 CodeSystems, the property code v2cs-uri
is used. The correct code is v2-cs-uri
.
Example:
<concept>
<code value="0719"/>
<display value="Access Restriction Reason Code"/>
<definition value="Table of codes specifying the reason for the restricted access. Note these codes are maintained within HL7, but outside of Version 2."/>
...
<property>
<code value="v2cs-uri"/>
<valueString value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
</property>
...
</concept>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.