Coder Social home page Coder Social logo

mohawkmedic / everest Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 22.0 490.17 MB

The Everest Framework is designed to ease the creation, formatting, and transmission of HL7v3 and CDA structures with remote systems.

License: Apache License 2.0

C# 99.25% Inno Setup 0.32% Batchfile 0.01% HTML 0.13% XSLT 0.30%
architecture ease everest everest-framework flexible hl7v3-standards mif transmission transport

everest's People

Contributors

medic-ideaworks avatar nityan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

everest's Issues

Issues with parsing component.section.text with paragraph xml element

When Everest parses certain medical section narratives within <text></text>, which are valid xml, it silently fails. For example, this section, taken from a NextGen example CDA r2:

<section>
  <templateId root="2.16.840.1.113883.10.20.22.2.12"/>
  <id root="2.201" extension="ReasonForVisit"/>
  <code code="29299-5" displayName="REASON FOR VISIT" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
  <title>Reason For Visit</title>
  <text>
    <paragraph>*** Most recent encounter only, dated '08/06/2012 10:59'. ***</paragraph>
    <paragraph>Mild Fever, 2 days</paragraph>
    <paragraph>Chills, 2 days</paragraph>
    <paragraph>Cough productive of greenish sputum, 2 days</paragraph>
  </text>
</section>

Specifically, it seems that Everest trips on the paragraph elements. I've attached a screenshot at a breakpoint showing the issue.

sc1

A potential workaround that I've thought of is simply modifying the document to replace <paragraph> and </paragraph> with <br/> before having Everest parse it, but I don't see why the framework fails on this relatively simple XML. Could it have something to do with the HL7v3 namespace being applied or not applied to the paragraph elements?

CDA ObservationMedia inheritance

Hello,

I need to add a custom attribute "ID" to the ObservationMedia class in order to get this:
<observationMedia ID="string identifier" classCode="OBS" moodCode="EVN">

To do so, I created a custom ObservationMedia as below:

[Structure(Name = "ObservationMedia", Model = "POCD_MT000040UV", StructureType = StructureAttribute.StructureAttributeType.MessageType)]
public class MyObservationMedia : ObservationMedia
{
[Property(
Name = "ID",
PropertyType = PropertyAttribute.AttributeAttributeType.Structural,
Conformance = PropertyAttribute.AttributeConformanceType.Optional)]
[System.Xml.Serialization.XmlAttribute("ID")]
public string ID { get; set; }

}

Then I registered the class in the formatter objet using:

fmtr.RegisterXSITypeName("POCD_MT000040UV.ObservationMedia", typeof(MyObservationMedia));

Finally I use my custom class just like a classic ObservationMedia object:
Component4 component4 = new Component4();
MyObservationMedia obs_l = new MyObservationMedia();
obs_l.ID = "myID";
// other object initializations
component4.SetClinicalStatement(obs_l);

Unfortunately I get the error "MyObservationMedia is not a valid choice according to available choice elements and won't be formatted".

I already did this for a custom ServiceEvent class and it worked fine. It seems that the Component4.ClinicalStatement is not allowing to a MyObservationMedia objet.
Do I need to override Component4.SetClinicalStatement(ObservationMedia value) and what to put in that function ?

Thanks
Remy

Any plans to make this available as a Nuget package?

Hello, I was wondering if you had any plans for making this library, at least the CDA data model, available via Nuget?
I am working on an application that runs in Azure SF and need to parse CDA into an object model, maybe using an Xml serializer to serialize a request body from a service call but I am having trouble understanding how I can use this library.
There is some documentation about generating a DLL (MARC.Everest.RMIM.UV.CDAr2.dll) but how can I just generate the source code? That would a be a way to get the model and not have to somehow deploy a DLL with my application in SF.
Any help is appreciated.
Thanks.

Miguel.

Where do we get MIF files?

I'm trying to use gmpr to create a library to handle documents with this extension oid:

<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:hl7-org:v3"
xmlns:cda="urn:hl7-org:v3"
xmlns:sdtc="urn:hl7-org:sdtc">
	<realmCode code="US"/>
	<typeId root="**2.16.840.1.113883.1.3**" extension="**POCD_HD000040**"/>

I can barely find any information on this anymore, much less a usable MIF file.

If they're out there, I'm struggling to find them. The closest thing to a MIF I have managed to find is this:

http://www.hl7.org/documentcenter/public/standards/V3/RIM/C30247/rim0247c.zip

I tried running the *.coremif files in that archive to see if I could get anywhere, and they fail to generate anything useful - something about not supporting RIM 2.1.7.

Any assistance would be appreciated.

Error: Could not find a type to de-serialize 'ClinicalDocument' into @ /urn:hl7-org:v3#ClinicalDocument

I'm using following code to parse the CCDA format .xml file in C#

var formatter = new XmlIts1Formatter();

            // Add CDA data types
            formatter.GraphAides.Add(new DatatypeFormatter() { CompatibilityMode = DatatypeFormatterCompatibilityMode.ClinicalDocumentArchitecture });

            // Disable validation
            formatter.ValidateConformance = false;

            // Open stream or data source
            using (var s = System.IO.File.OpenRead(filePath))
            {
                var result = formatter.Parse(s, typeof(ClinicalDocument).Assembly);
                var instance = result.Structure as ClinicalDocument;

                // do whatever you like with the CDA
            }

image

Section.NullFlavor = NullFlavor.NoInformation issue

I have Section objects that I am setting the Code, Title, and Text properties on.

When I have entries for the section, I create the Entry objects and add them to the Section object. At document creation time everything looks good and validates.

When I do NOT have entries I am setting section.NullFlavor = NullFlavor.NoInformation; and all I get at document creation time for the section is: <section xsi:nil="true" nullFlavor="NI" />

The problems are:

When I validate I get

Attribute 'http://www.w3.org/2001/XMLSchema-instance,nil' must not appear on element 'section', because the {nillable} property of 'section' is false.

The other properties (like Code, Title and Text) are not rendered to the xml.

What am I doing wrong?

ObservationValue type ANY and multiple value loading

Hello,

Strangely, the RIM model set ObservationValue type to ANY, with maximumMultiplicity="*". I was expecting SET.

In my case I have multiple values in my observation

...


And running Everest I get only the last one.

Can you confirm this is normal behavior or is there a way to get multiple values loaded in the ANY type ?

Thanks

Source

Hi,

Where do I find the the source for the assemblies located in the Solution Items folder?

Thanks.

asp-net core System.NotSupportedException

Hello,
I am trying to use the framework on an asp.net core mvc project but I get an runtime exception. I am able to build the XML document, but directly after that I get the following exception:

System.NotSupportedException
HResult=0x80131515
Message=The invoked member is not supported in a dynamic assembly.
Source=mscorlib
StackTrace:
at System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
at MARC.Everest.Formatters.XML.ITS1.CodeGen.CodeGenFormatter.CreateFormatterAssembly(Type[] rmimTypes, List`1 aides, Boolean generateDeep)
at MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter.BuildCache(Type[] t)
at MARC.Everest.Threading.WaitThreadPool.DoWorkItem(WorkItem state)
at MARC.Everest.Threading.WaitThreadPool.DispatchLoop()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

I am using the .NET Framework 4.6.1 and I already know that the problem comes from my method for formatting the document:

private static void PrintXml(ClinicalDocument ccda, Stream stream)
{

        MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter fmtr = new MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter();
        fmtr.GraphAides.Add(new DatatypeFormatter());
        fmtr.ValidateConformance = false;
        XmlStateWriter xsw = new XmlStateWriter(XmlWriter.Create(stream, new XmlWriterSettings() { Indent = true }));
        fmtr.Graph(xsw, ccda);
        xsw.Flush();
    }

If someone can help me fixing this I would be really thankful

Multiple Race Codes in CDA

I'm having a difficult time getting this to work. I've reviewed the following pages:
https://everest.codeplex.com/discussions/653908
http://te.marc-hi.ca/forums/default.aspx?g=posts&t=58

In my source XML I have the following:

<raceCode code="2106-3" displayName="White" codeSystem="2.16.840.1.113883.6.238" codeSystemName="Race &amp; Ethnicity - CDC"/>
<sdtc:raceCode code="2108-9" displayName="White European" codeSystem="2.16.840.1.113883.6.238" codeSystemName="Race &amp; Ethnicity - CDC"/>

Which fails to parse with the this error: System.Xml.XmlException: Can't parse 'raceCode' in namespace 'urn:hl7-org:sdtc'. The data does not appear to be an HL7v3 instance

This is my test that is blowing up:

        [TestMethod]
        public void ParseCcd()
        {
            var formatter = new XmlIts1Formatter();
            formatter.ValidateConformance = false;
            formatter.GraphAides.Add(new ClinicalDocumentDatatypeFormatter());
            formatter.RegisterXSITypeName("POCD_MT000040UV.Patient", typeof(MyPatientMultipleRaceCodes));
            formatter.Settings |= SettingsType.SuppressNullEnforcement | SettingsType.AlwaysCheckForOverrides;
            formatter.ValidateConformance = false;

            ClinicalDocument cda;
            using (var xr = new XmlStateReader(XmlReader.Create(@"C:\CDA_Tests\170.315_b1_toc_amb_ccd_r21_sample1_v8.xml")))
            {
                var result = formatter.Parse(xr, typeof(ClinicalDocument));
                cda = result.Structure as ClinicalDocument;
            }
        }

When I am rendering XML I have a different problem in that only one of the race codes is being assigned to the sdtc schema:

<sdtc:raceCode code="2106-3" codeSystem="2.16.840.1.113883.6.238" displayName="White" />
<raceCode code="2106-3" codeSystem="2.16.840.1.113883.6.238" displayName="White" />
<raceCode code="2108-9" codeSystem="2.16.840.1.113883.6.238" displayName="White European" />

Generated from this method:

        private MemoryStream RenderCda(ClinicalDocument cda)
        {
            XmlIts1Formatter fmtr = new XmlIts1Formatter();
            fmtr.RegisterXSITypeName("POCD_MT000040UV.Patient", typeof(MyPatientMultipleRaceCodes));
            fmtr.Settings |= SettingsType.SuppressNullEnforcement | SettingsType.AlwaysCheckForOverrides;
            fmtr.GraphAides.Add(new DatatypeFormatter());
            fmtr.ValidateConformance = false;

            // Prepare the output 
            var stream = new MemoryStream();
            XmlStateWriter xsw = new XmlStateWriter(XmlWriter.Create(stream, new XmlWriterSettings() { Indent = true }));
            xsw.WriteStartElement("ClinicalDocument", "urn:hl7-org:v3");
            xsw.WriteAttributeString("xmlns", "sdtc", null, "urn:hl7-org:sdtc");

            fmtr.Graph(xsw, cda);
            xsw.WriteEndElement();

            xsw.Flush();
            stream.Position = 0;

            return stream;
        }

I've been banging my head against this for quite awhile now. Any help would be welcomed.

Class that inherits from ClinicalDocument throws IndexOutOfRangeException

If I create an empty class that inherits from ClinicalDocument, map some data into it and call this extension method on it I get an IndexOutOfRangeException:

    public static void ToStream(this ClinicalDocument clinicalDocument, Stream outputStream)
    {
        XmlWriter xw = XmlWriter.Create(outputStream, new XmlWriterSettings() { Indent = true });
        XmlStateWriter xsw = new XmlStateWriter(xw);
        XmlIts1Formatter xf = new XmlIts1Formatter();
        IFormatterGraphResult result = xf.Graph(xsw, clinicalDocument);
        xsw.Flush();            
    }

If I do the same mapping to a direct instance of ClinicalDocument itself it works. Why does it throw the exception on classes that inherit from ClinicalDocument?

For example:

public class TestDocument : ClinicalDocument
{}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.